Search Unity

Hinge joint inconsistent in respecting rotation locks

Discussion in 'Physics' started by raithza, Jan 22, 2019.

  1. raithza

    raithza

    Joined:
    Dec 14, 2011
    Posts:
    21
    Since upgrading to Unity 2018.3, I've noticed some weirdness in some joints we were using. After some frustrating debugging, I noticed that Unity can be very inconsistent in how it enforces angular motion when set to "locked".

    This is hard to explain in words, so I've made a small video to exactly demonstrate the issue:



    In that project, a simple rigidbody/collider/joint has been configured with a hinge joint, as one might do for a lever. All motion is locked except X Angular which is limited to [-45,45]. The "Hand" object has a configurable joint with motion locked and rotation free, attached to the end of that hinge joint (this is a simplified form of how one might model a hand grabbing onto that lever in VR). Note that if I move the hand to the left or to the right, the lever incorrectly rotates along the Y axis.

    I then go and duplicate the lever/hand pair. When I start the project again, and attempt the same motion as I did before, the lever joint operates how I expect it to (ie it only rotates along its x-axis). Can anyone explain why this is, or how I might work around it?