Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  extanding the rope from its end towards a diractino using the RopeCurser
#4
Hi,

There’s nothing in your code that would make the rope shoot in a straight line :/. In the Update() method you remove the velocity from all particles in the rope, and change the position of the last particle.

Then you change the rest lenght of the rope using the cursor. This will simply add extra particles to your rope, but will not place them in a line (specially not if you set their velocities to zero!). Also note that changing the lenght using a cursor might add/remove more than one particle per frame, depending on the difference between the previous length and the new length.


If you want to override the simulation when the rope is being shot, and make the rope extend in a straight line, you need to set the position of *all* rope particles so that they follow a line, or at the very least all particles added by the cursor since last frame.

Will write some sample code for you tomorrow morning. Kind regards,
Reply


Messages In This Thread
RE: extanding the rope from its end towards a diractino using the RopeCurser - by josemendez - 12-01-2022, 06:55 PM