- Home /
How to create a freely swinging "rope" of modifiable size between two rigid bodies?
Hello, I'm relatively new at this and I'm looking for a way to make a simple "rope" between two rigidbodies that can have its size changed in-game, decreasing or limiting the distance between the rigidbodies.
I was thinking of using a raycast to anchor this "rope" to the surface of a target rigidbody, where the ray contacts, and have the other end on the center of the player rigidbody.
When the "rope" is created, both ends should be free to swing in any direction or axis.
•In the default state, the "rope" shouldn't allow the distance between the rigidbodies to increase, but it should automatically get shorter if the distance happens to decrease, no matter what causes that. In this state the effects of the "rope" can only be felt if the rigidbodies try to drift apart.
•In the "pulling" state, the "rope" will actually pull both rigidbodies together, actively decreasing the distance. This the only state in which the "rope" should be responsible for a change the distance, instead of relying on external influences.
•In the "release" state, the rope will automatically get longer if the distance happens to increase, no matter what causes that. This state makes it so the effects of the "rope" cannot be felt, but it is still active.
The player can decide when to undo the grapple and the joint or joint-like behavior is destroyed, releasing the rigidbodies.
Here is a visual of what I have in mind: Thanks in advance for any help!
Your answer
Follow this Question
Related Questions
Configure configurableJoint to act as the disctontinued driveJoint 0 Answers
Connect rigidbody to another moving rigidbody to simulate a hanging weight 0 Answers
Hinge Joint Giving Fake 'Slack' 0 Answers
Hinge Joint? Unconstrained. 1 Answer
Violent shaking when using position drive in Configurable Joints 1 Answer