Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Rope lenght on demand
#3
(10-05-2018, 08:22 AM)josemendez Wrote: 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.

You are correct, that's exactly what I did. A rigidbody; got it's velocity magnitude; changeLenght(rbMagnitude) on fixed update. However, one factor I did not include was the mass.

Will play around with it. Hope it works.

Thanks for the quick reply Sonrisa
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