10-06-2020, 08:12 PM
(10-06-2020, 08:01 PM)josemendez Wrote: Simply stretching the rope won't work. In real life, imagine that you have two objects at 1 meter from each other, joined by a 1 meter long rope. Then, you suddenly separate the objects so that there's now 2 meters between them: the rope would simply break (or, prevent you from separating the cubes, depending on the force used to pull the objects apart from each other).
You need to actually change the rope rest length to match the distance between the two cubes. That's what cursors are for:
http://obi.virtualmethodstudio.com/tutor...ursor.html
They let you add "more rope" at any point in the rope, in any direction.
Yes, you can do this using cursors. They are designed to change the rope rest length at runtime. Check out the "Crane" and "GrapplingHook" sample scenes. They both do what you're asking for, specially the grappling hook one.
Okey that sounds good, but I think that will be easy just if the rope is straight and the two cubes move in a straight movement, so we can add edit the rope's length depending on the distance between the two cubes, but how can we do that when the rope is foldable and not straight? I mean in case the rope is stretched by other object's movement, how can we track that and then increase its length depending on the contact with the other object?