Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Rope lenght on demand
#2
(09-05-2018, 05:40 PM)Jimess Wrote: Hi,

Bought this tool recently for a single straightforward task - I want my rope to extend on demand (i.e. when you shoot a harpoon, I want the rope to follow the tip until the rope's maximum lenght is reached).
Right now I've played quite a lot with Obi Rope but the ChangeLenght method just can't keep up with my "tip" object. Whenever I shoot the object it feels like the rope just drasticly stops my gameobject. Doesn't matter how often I call the change length method.


So my question - is there any way to achieve the "extend on demand" effect with Obi Rope?

Hi,

As long as you call ChangeLength at the appropriate time, it should work fine.

I'm assuming the harpoon is a rigidbody, as such, it moves dusting FixedUpdate(). This means you need to predict how much the harpoon is going to move during this frame (use its velocity) and then call ChangeLength() so the rope is long enough to be completely extended at the end of that frame, when the simulation has finished (the harpoon has moved).

If you extend the rope when FixedUpdate has finished, the rope and the harpoon have already been simulated and the rope has of course stopped the harpoon because it was too short.

Also, make sure the mass of your harpoon is high enough (in relation to the rope's) so that the rope will not drastically affect its velocity.
Reply


Messages In This Thread
Rope lenght on demand - by Jimess - 09-05-2018, 05:40 PM
RE: Rope lenght on demand - by josemendez - 10-05-2018, 08:22 AM
RE: Rope lenght on demand - by Jimess - 10-05-2018, 03:39 PM