The simplest chain of ConfigurableJoints is deformed in a strange manner

Hi,

I’ve made the simplest chain of ConfigurableJoints. All the RigidBodies, colliders and ConfigurableJoints are identical. When I add a drive to make the chain stiffer, like a spring, the deformation is not smooth and it seems like one joint out of two is bending in the wrong direction.

7551625--933637--CJ bug.gif

Here is a typical game object in the chain

I’ve tried with all objects as siblings, and as a hierarchy, it made no difference (as it should).
7551625--933619--upload_2021-10-6_17-36-25.png

I also tried to change the number of solver iterations from 6 to 200 and it doesn’t change the general behavior. I also tried to push it with a non-kinematic RigidBody (instead of the cube in the gif) with no difference.

There is nothing fancy, no custom script, just capsules, RigidBodies and ConfigurableJoints

Why is the solver not able to produce a smooth deformation along the joint chain? why is one joint out of two seems to be going in the wrong direction?

Thank you for your time !

Try the other solver if you haven’t already. It’s supposed to be better with joints. Change it in the physics preferences.

Also try lowering the fixed timestep.

Try disabling pre-processing.

And finally, try projection angle and distance.

edit - Also, if you are moving that box with the mouse, it may not give the best representation of what is happening. Use a rigidbody with forces to collide with your joint setup.

A kinematic Rigidbody moved using MovePosition / MoveRotation from FixedUpdate would also work.

1 Like

Thank you for your advice. The temporal GS solver type produce a very different result, with the chain being bent only on one or two joints, with the other joints staying straight. There is no bending in the wrong direction. So it is even less smooth, but in a way also less buggy. Not the solution, though.

Greater and lower timestep affect the speed and the stable pose, but not the general bugged behavior.

Disabling pre-processing moves joints a bit, but does not change the general behavior.

Projection distance and angle, after enabling them, changed the precision but not the general behavior.

Also, I understand that applying force from a kinematic, perfectly world-aligned, mouse-driven cube is wrong in many ways but the bug is initially detected in a normal physic environnement, with complexe physic objects pushing on other ones. This is a simplified showcase made to reproduce the bug in the simplest situation.

I also just tested with two spheres instead of a capsule as colliders, to no avail.

Even with a single sphere collider on each body, they are still forming pairs. One joint is bending out of two, while the other is staying straight, and even bending slightly in the wrong direction.

What about the mass of each rigid body joint. I think it is generally better if the mass decreases slightly down each joint of the hierarchy?

And what is the mass relation between the box and the joints. Ideally there should be no more than 10x difference I believe.

That shouldn’t have any effect here. That rule applies to objects that are directly linked with joints. In this case even a box collider alone without rigidbody would cause the same effect.

1 Like

I’ve tried reducing the weight linearly. The stiffness change along the chain accordingly, but the pairs of joint are still clearly visible.

In the real game, the effect is noticeable when the chain is pushed by other objects with similar masses, and also when it is pushed on a wall with no RigidBodies.

I don’t know then, not much else to try :shrug

Maybe you could use articulation body’s instead, perhaps they might be better for your use case?