Now I know what you mean. The problem in this case is that Unity's physics system lets joints move away from their anchor when the force is high enough, even if there should be no translation allowed by the setup. This is an old problem in Unity and is there a long time already - 8 years ago I also had to work around this problem.
One workaround to stabilize every joint is to attach a script like this one:
using UnityEngine;
public class FixPosition : MonoBehaviour {
Vector3 correctLocalPosition;
void Start () {
correctLocalPosition = this.transform.localPosition;
}
void LateUpdate () {
this.transform.localPosition = correctLocalPosition;
}
void FixedUpdate() {
this.transform.localPosition = correctLocalPosition;
// note that rigidbody.velocity and rigidbody.angularVelocity could also be
// clamped to custom maximal values to prevent short frantic rotation.
}
}
You can disable Hide Shadow
at the SkeletonUtilityKinematicShadow
component and attach the above script to every generated hinge-joint GameObject node.
Please let me know if this fixes your problem.
I will mark this as a later improvement to be done automatically by the SkeletonUtilityKinematicShadow
, since many users might find this useful.