Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Extending Grappling Hook & Collision Detection
#5
(14-05-2026, 02:08 AM)docgonzzo Wrote: Hello again!

Thank you so much for the advice. I figured there was a better way of doing this.

I tried your suggestion of using the raycast and that has improved things. I am still seeing some tunnelling but that is now a function of the extend speed. Basically the faster the tether extends the greater the distance from the last particle's position previous frame vs current frame..

To get rid of the speed dependant tunneling, do the raycast *before* actually extending the rope. Your code extends the rope and then checks if it hit anything, if it did, the rope has already been extended and has left the raycast hit point behind it.

Do not explicitly store lastParticlePosOld: instead use solver.positions[tipParticle] before setting it to origin + direction * length as the old position, and use origin + direction * length as the new position  (which is where we will be moving the particle this frame). If you hit something, reduce length to only extend the rope up to the raycast hit. This way you ensure the rope always ends up extending the right amount.

kind regards,
Reply


Messages In This Thread
RE: Extending Grappling Hook & Collision Detection - by josemendez - 14-05-2026, 07:30 AM