Search Unity

Configurable Joint's Projection Mode Issues

Discussion in 'Physics' started by Warrior1424, Feb 19, 2017.

  1. Warrior1424

    Warrior1424

    Joined:
    Sep 30, 2010
    Posts:
    984
    So, I have a door handle.
    Using a configurable joint I have its position locked and all but one axis locked.
    If I hit play, the handle rotates around this axis as a result of gravity pulling the end of the handle downwards.
    Pushing the handle beyond its limits causes it to freak out as expected.

    To fix this I set Projection Mode to Position and Rotation, with Projection Distance set to 0.01 and Projection Angle set to 1.
    If I hit play the first thing you notice is that the handle does not rotate as expected, it just sits frozen in place.
    If I push the handle at all in any way it starts freaking out like crazy for a few seconds after I stop pushing it.

    I've heard that Projection Mode does not work well with limits (I can't imagine any other situation you would use this feature though).

    It's almost like the Projection Mode stuff is applied before the rigidbody can even move or rotate. For example setting the Projection Angle to 25 degrees will always keep it within 25 degrees of its initial rotation, not within 25 degrees of the limits the joint. There's no way that can be the intended use.
    Is there something I can do about this, or must I clamp the position and rotation manually in the code?\
    Thanks