Unity Physicals Rigidbody with multiple colliders

Rigidbody with multiple colliders

adding colliders changes the center of mass and rotation behaviour of a rigidbody. To set those manualy to the center of the object use:
void Start()
{
    rigidbody = GetComponent<Rigidbody>();
    rigidbody.centerOfMass = Vector3.zero;
    rigidbody.inertiaTensorRotation = new Quaternion(0, 0, 0, 1);
}

Ref: https://forum.unity.com/threads/rigidbody-with-multiple-colliders.524352/

猜你喜欢

转载自www.cnblogs.com/open-coder/p/12081386.html