Joint Separating Weirdly

I have a chain of objects all connected to eachother with distance joints. The distance joints’ distances are mostly set to 0.005 except the first one, which is connected to a moving frog. the end of the chain has forces being applied on it in FixedUpdate. However when the forces are applied to the end of the chain the chain separates in weird ways, like so:


I’ve tried lowering the FixedTimestep to as low as 0.0001 (it didn’t work, just lagged a lot). Help please?

The joints are on each segment, connected to the segment closer to the frog.

Is there something I’m missing?

In the end, chains of joints are only stable if you’re careful and are not applying crazy forces which is often the case. The solver can only use the number of solver interations that are specified in the physics settings so I guess you’ve not increased those.

Changing the time-step to try to run physics 10,000/sec shows you’re wildly guessing. I would highly suggest you get to grips with a smaller experiment first as you cannot just brute-force chains of joints and expect them to be stable.

If you want to maintain a “chain” of joints but ensure they don’t stretch beyond a certain distance then you can add another DistanceJoint2D from the anchor to the end of the “chain” and select “Max Distance Only”.

You can see this exact example in my GitHub repo that shows examples for most of 2D Physics.

1 Like

Hey thanks for your answer! And your clever use of the distance joint was really clever! In your video, are the individual chain segments linked together with distance joints or hinge joints? Does that make any difference?

Edit: nevermind, I got your repo

1 Like

And also even when I am simply holding the chain at a fixed point it still breaks apart.

It appears the distance joints are less stable than hinge joints at small distances…

Thanks for yer help