Grappling Hook with Spring Joint

Hi everyone,

i am trying to make a grappling hook similar to the one of Pathfinder in Apex or like the one in this video.

The one in the video looks pretty smooth and was made with a spring joint. So what i made was shooting a raycast where the player clicks, on impact creating a object with a rigidbody(isKinematic) and adding this rigidbody to the spring joint on the player. The spring joint is only attached to the player while he is grappeling. But somehow i cant get the spring joint to work properly. The player is mostly swinging upwards and is just slowly pulled to the attached object.

The goal is to have a grappling hook which does not pull the player direct to the anchored spot, but pulling him while he still keeps the momentum in the direction he is currently moving. Like that he would be able to swing around poles and gathering momentum by swinging.

If anyone has a clue what i am doing wrong please let me know :slight_smile:

This is how the spring joint gets set up:

If you want the joint to try and keep the same length, set the min and max distance to the current distance.

If you never want the spring to push you away, keep min to 0.

If you want the spring to get shorter, but avoid getting longer again, change the max distance to the current distance every frame.

Basically the spring will try to keep the length between min and max.

The higher the spring value, the more violently the spring will try to keep the value inside the range. The higher the damper value, the less “bouncing” between values you’ll have.