Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Spawning a rope along a line the player draws
#2
Hi!

Don't set the cursorMu before changing length. This will force the cursor to reset the amount of length already added to zero, which may cause particles to be added immediately one after another.

Another problem is that you're not accounting for the rope's simulation, the newly added particle(s) should be placed in a straight line from the tip of the rope to the mouse cursor. Otherwise the rope is free to move anywhere and this might cause a feedback loop where the simulation itself increases the distance from the mouse if _tipRigidbody is attached to the rope.

You're doing this in FixedUpdate, which means that some frames you might be increasing the length twice or more times, some frames you might not be increasing it at all. It may also update the length before or after ObiFixedUpdater(), so this might happen before or after simulation. A much better alternative would be to do this in LateUpdate().

let me know if I can be of further help!

cheers,
Reply


Messages In This Thread
RE: Spawning a rope along a line the player draws - by josemendez - 20-03-2024, 07:12 AM