Z axis shifts

        if (Input.GetAxis("Mouse X") > 0)
        {
            gameObject.transform.Rotate(new Vector3(0, 1, 0));
        }
        else if (Input.GetAxis("Mouse X") < 0)
        {
            gameObject.transform.Rotate(new Vector3(0, -1, 0));
        }
        if (Input.GetAxis("Mouse Y") > 0)
        {
            gameObject.transform.Rotate(new Vector3(-1, 0, 0));
        }
        else if (Input.GetAxis("Mouse Y") < 0)
        {
            gameObject.transform.Rotate(new Vector3(1, 0, 0));
        }

8479481--1127246--upload_2022-9-30_14-35-9.png
Why not “Z = 0”?

“Typically, you rotate objects in your scene using the Transform component, which displays orientation as a Euler angle. However, Unity stores rotations and orientations internally as quaternions”

1 Like

Moar…

All about Euler angles and rotations, by StarManta:

https://starmanta.gitbooks.io/unitytipsredux/content/second-question.html