Can you increase or decrease the distance of a node to a PinJoint2D?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By clotet

I’n trying to implement a rope swinging mechanic similar to the rope in Worms Armageddon or similar games, and the PinJoint2D works perfectly if I just want to swing from a point, but I also wanted to have the ability to increase or decrease the length of the “rope” to the joint point.

I use a StaticBody2D as a fixed point for the PinJoint2D, and I’m attaching a RigidBody2D. If I try to apply any forces to the RigidBody2D it only affects its angular velocity (of course, as you would expect). I also tried to move the RigidBody2D’s position manually, and that kind of works, but not as you would expect, when I stop moving it the joint takes control again and the node goes back to its original position.

I understand that’s how the PinJoint2D is supposed to work, but I can’t figure out how to use it for my case, or if there’s any way. I tried different things, such as combining different joints and rigidbodies to simulate what I want to do, but with no luck for now.
Any ideas will be greatly appreciated.