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/

posted @ 2019-12-22 22:17  opencoder  阅读(235)  评论(0编辑  收藏  举报