How to make an extentable rope? #316
Replies: 4 comments 3 replies
|
Can you delete one of the rigidbodies and move the pin joint A from the previous rigidbody to the static body connection point? Would it move it by force to the new point in that case? Eg: |
|
Do you have any examples I can look at, an example project I can test this? The rope joint is not exposed rn at all through godot rapier afaik. |
|
I ended up being able to use DampedSpringJoint2D, realised that I was not using length and initial_length correctly, basically I must change both at the same time for the expanding and contraction to happen. Thanks again for porting Rapier! |
|
Nice, show a video of final product, am curious. |
Uh oh!
There was an error while loading. Please reload this page.
I’m trying to do this for literally weeks/months now, but every time I think I’m close to a solution, it fails. This is my current game, you can see a rope made of several rigidbodies.
2024-12-07.19-00-55.mp4
So my frog player shoots a rope that glues to the surface and to him. My frog is a rigidbody, because I want him to be effected by the physics engine and other characters. I also created the rope to be a rigidbody, so it can interact with the world and other characters as well.
The challenge: To shorten and extend the rope length. Seems simple enough, but:
1 changing the length of the rigidbodies don’t do anything because the pinjoint stays in the same place,
2 changing the connecting place of the pinjoint is also not possible. I tried with some hacks but nothing good happened with it
3 I tried connecting each pinjoint to a static body that was connected to the rigidbody and when extending I would just move the static body outward, and although I had some success while testing this, it just became too unstable with the actual rope, everything disconnects
Any other suggestions would be greatly appreciated, thanks!
All reactions