How do I fix ragdoll shaking uncontrollably?

Hey, I’m trying to create a ragdoll effect for my skinned mesh character. However, I’m encountering an issue where the model starts shaking uncontrollably.

The script adds parts for each bone in the model and then connects them with a BallSocketConstraint. Then the bone is moved to the corresponding part in every frame.

The model doesn’t shake when the HumanoidRootPart is touching the ground. However, this makes the model hover slightly above the ground and isn’t very reliable. I’m also creating a WeldConstraint between the body mesh and the core bone. This has the same effect as the HumanoidRootPart where it stops shaking if the part connected to the body is big enough to touch the ground.

Video where the core part isn’t touching the ground:

Video where the core part is touching the ground:

Any help is greatly appreciated! :grinning: