Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Fishing Line
#1
Pregunta 
Hi,
i want to make a realistic fishing line with the Obi Rope. So my problem. I have a fishing rod where the first Particle Group is attachet and one other Particle Group that is attachet to a hook. Now i want to throw the hook into the water with a Rigidbody.addForce() the hook trys to fly away but buggs back to the end of the line. I want the line to follow the Hook when the hook is flying but it looks like the Hook get stopped by the line because the line dont fly with the hook  and dont get longer. The Line should get longer when the hook is flying away. That means the Line should not be strechet ist should get more Length like a real fishing line when you throw it out. And stop for example when it hit collider.tag = "Water". 

In the video i added you can see the Setup and at the end when i start the scene you see the Lure(My Hook) bugs. Everytime it trys to fly forward i press the right mouse Button. So everytime i try to let it fly it buggs back to the end of the line.


And one other question i dont get how the Stretching scale and the Stretch compliance works. When i put the Stretch Compilance on a value like 0.05 my whole hook falls down like 50-100 on the y. is it normal that such a low value = So much stretch? my current value ist 0.0001 and ist still stretching a bit.

My Setup:

The Rope has following Components:
Obi Rope
Obi Path Smoother
Obi Rope Extruder Renderer
Obi Particel attachment x2
Obi Rope Cursor
And my Script that should Refresh the length when the hook is flying.(What is not working)

The Hook Setup:
Rigidbody
ObiRigidbody
Collider
ObiCollider
And a script that throws the Hook away(forward) from the Camera with Rigidbody.Addforce(...., forcemode.impulse)
Reply
#2
(5 hours ago)SemtrexHD Wrote: I want the line to follow the Hook when the hook is flying but it looks like the Hook get stopped by the line because the line dont fly with the hook  and dont get longer. The Line should get longer when the hook is flying away.
That means the Line should not be strechet ist should get more Length like a real fishing line when you throw it out. And stop for example when it hit collider.tag = "Water". 

Hi!

Unless you explicitly write a script that does this, the rope won't automatically increase its length to follow the hook or stop doing so on a specific condition. The way you change the length of a rope at runtime is by using a cursor and calling its ChangeLength() method in your scripts, passing how much length you want it to increase/decrease.

You can see examples of cursors being used to increase the length of a rope in various of the included sample scenes (Crane, FreightLift, GrapplingHook, to name a few).


(5 hours ago)SemtrexHD Wrote: And one other question i dont get how the Stretching scale and the Stretch compliance works. When i put the Stretch Compilance on a value like 0.05 my whole hook falls down like 50-100 on the y. is it normal that such a low value = So much stretch? my current value ist 0.0001 and ist still stretching a bit.

Compliance (aka flexibility) is the inverse of stiffness, so yes very small values are to be used. Rubber for instance has a compliance of 1x10^-6 m/N (that is, 0.000001). You can look up material compliance tables online.

A compliance of 0 means "as stiff as possible, given current simulation budget" which is the default. You can increase the simulation budget by spending more substeps on the solver. Using more substeps (or decreasing rope resolution) will yield a stiffer rope.

The manual contains a very in-depth explanation of how the engine works internally and how substeps/iterations affect simulation quality.

(5 hours ago)SemtrexHD Wrote: And my Script that should Refresh the length when the Line ist getting stretcht.(What is not working)

So you do have a script that changes the length of the rope? Could you share your code so that I can take a look?

kind regards,
Reply
#3
As a side note, other users have created fishing rod setups in the past. May be relevant to your use case:
https://obi.virtualmethodstudio.com/foru...-4062.html
http://obi.virtualmethodstudio.com/forum...-4331.html
Reply
#4
(5 hours ago)josemendez Wrote: Hi!

Unless you explicitly write a script that does this, the rope won't automatically increase its length to follow the hook or stop doing so on a specific condition. The way you change the length of a rope at runtime is by using a cursor and calling its ChangeLength() method in your scripts, passing how much length you want it to increase/decrease.

You can see examples of cursors being used to increase the length of a rope in various of the included sample scenes (Crane, FreightLift, GrapplingHook, to name a few).



Compliance (aka flexibility) is the inverse of stiffness, so yes very small values are to be used. Rubber for instance has a compliance of 1x10^-6 m/N (that is, 0.000001). You can look up material compliance tables online.

A compliance of 0 means "as stiff as possible, given current simulation budget" which is the default. You can increase the simulation budget by spending more substeps on the solver. Using more substeps (or decreasing rope resolution) will yield a stiffer rope.

The manual contains a very in-depth explanation of how the engine works internally and how substeps/iterations affect simulation quality.


So you do have a script that changes the length of the rope? Could you share your code so that I can take a look?

kind regards,
public class RopeLengthController : MonoBehaviour
{
    public bool StartThrow;
    public ObiRope rope; // Das Obi Rope-Objekt
    public ObiRopeCursor cursor; // Der Obi Rope Cursor, um die Länge zu ändern
    public Rigidbody bait; // Der Köder (bereits mit der Schnur verbunden)
    public Transform rodTip; // Spitze der Angelrute
    public float maxLineLength = 50f; // Maximale Länge der Angelschnur
    public float minLineLength = 1f; // Minimale Länge der Angelschnur
    public float speedMultiplier = 0.1f; // Multiplikator für die Verlängerung basierend auf Geschwindigkeit
    public float tensionThreshold = 1f; // Schwelle, ab der Spannung die Schnur verlängert

    private float currentLength; // Aktuelle Länge der Schnur

    void Start()
    {
        currentLength = rope.restLength; // Setze die aktuelle Länge auf die Ruhelänge
    }

    void FixedUpdate()
    {
        if (StartThrow)
        {
            // Berechne die Distanz zwischen Angelspitze und Köder
            float distance = Vector3.Distance(rodTip.position, bait.position);

            // Wenn die Distanz größer ist als die aktuelle Seillänge, verlängere die Schnur
            if (distance > currentLength)
            {
                float newLength = Mathf.Min(distance, maxLineLength);
                cursor.ChangeLength(newLength - rope.restLength);
                currentLength = newLength;
            }
        }
    }
}

(5 hours ago)josemendez Wrote: As a side note, other users have created fishing rod setups in the past. May be relevant to your use case:
https://obi.virtualmethodstudio.com/foru...-4062.html
http://obi.virtualmethodstudio.com/forum...-4331.html
yes the video on the first link looks pretty good and i want it like that the only difference i want to use Rigidbody.Addforce(impulse) but i dont get it how to do it.
Reply
#5
Hi! I'm very novice.
But it seem to me that for simulating a release of throw of line you would want to first only release the thread (Start you script) when you've made the bait in motion by the swing of the rod. You probably also want to take note on the mass differences between the line and bait, as the momentum of the bait should be pulling the rope and not vice versa.
Reply
#6
(1 hour ago)Jawsarn Wrote: Hi! I'm very novice.
But it seem to me that for simulating a release of throw of line you would want to first only release the thread (Start you script) when you've made the bait in motion by the swing of the rod. You probably also want to take note on the mass differences between the line and bait, as the momentum of the bait should be pulling the rope and not vice versa.
i start the Script when the bait its already in motion. When you look at my Script the If statement with the If(StartThrow) only get true when the Bait Rigidbody got a force by rb.Addforce. So if the Bait gets a force then StartThrow gets true. I dont use the Rod swing for the motion i just want that the Bait flys forwad by pressing a button. And what do you mean with the mass? do you mean the Particle group should have a lower mass than the bait rigidbody?
Reply
#7
(1 hour ago)SemtrexHD Wrote: i start the Script when the bait its already in motion. When you look at my Script the If statement with the If(StartThrow) only get true when the Bait Rigidbody got a force by rb.Addforce. So if the Bait gets a force then StartThrow gets true. I dont use the Rod swing for the motion i just want that the Bait flys forwad by pressing a button. And what do you mean with the mass? do you mean the Particle group should have a lower mass than the bait rigidbody?
Ok, yeah I mean from experience of the few time I've been fishing I would only release the line at the end of the swing motion, so that the line first the one pulling the bait to get the velocity from the rod. But it seems you're simplifying that step to adding an impulse right away at the start of the swing.

And for mass yes I mean that the particle group should have lower mass than the bait. If you use default mass of particle it seems from the video that the bait weighs the same as a particle right now. Asking GPT it would be something in the rounds of factor of 100 and above of difference in real life.
Reply