Search Unity

Rotating just X and Z axis changes Y angle?

Discussion in 'Physics' started by fuzymarshmello, Feb 22, 2015.

  1. fuzymarshmello

    fuzymarshmello

    Joined:
    Feb 22, 2015
    Posts:
    17
    Basically this is my code

    rigidbody.AddRelativeTorque (new Vector3 (forwardAndBack, 0, -leftAndRight)*5f);

    It works great, but it changes the Y rotation too. How can I stop that from happening?