- Home /
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. https://www.youtube.com/watch?v=rb0EhmyQ0aM
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 :)
This is how the spring joint gets set up:
Answer by lgarczyn · Jan 12, 2020 at 01:54 AM
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.
Your answer
Follow this Question
Related Questions
How to go about filling the gaps between segmented objects connected with hinge joints? 0 Answers
Why does unity combine Y and Z angular drive in configurable joints? 0 Answers
Trying To Make Burger Builder 1 Answer
How to configure a rope like joint 0 Answers
Rope Physics using Spring Joints 3 Answers