Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

eulerAngles not accounting multiple instances

Discussion in 'Navigation' started by ryanmerritt25, Jun 18, 2015.

  1. ryanmerritt25

    ryanmerritt25

    Joined:
    Nov 1, 2013
    Posts:
    1
    So i'm making a 3d spaceship game and i'm trying to get the pitch and yaw set up and they work just fine EXCEPT when i have more than one eularAngle in the code. It will only register the most recent code instead of all of them when i hit play. In the code below it will only register "Roll" but not "Horizontal" and if i were to switch them around it would register "Horizontal" but not "Roll". Please help


    Code (CSharp):
    1.     void FixedUpdate () {
    2.  
    3.         pitch += Input.GetAxis ("Horizontal");
    4.         transform.eulerAngles = new Vector3(0,0,pitch + speed);
    5.  
    6.         roll += Input.GetAxis("Roll");
    7.         transform.eulerAngles = new Vector3(roll,0,0);
    8.