How to prevent transform.Rotate from oddly flipping other axis...

I am having a really weird issue with an extremely simple thing.

if (Input.GetKey(KeyCode.D)) { rocket.transform.Rotate(30 * Time.deltaTime,0,0); }

When I run this it turns my rocket just fine, however, as I turn, when I reach 90 degrees it suddently and for no appearant reason flips z and y to 180 degrees as indicated by the inspector and evident by the output of eulerAngles. Why does it do this and how can I stop it?

You can’t stop it; that’s a side effect of Unity storing rotations as quaternions. There’s more than one valid way to represent a quaternion as euler angles. This isn’t an error or anything; everything still works as expected. For example, (0, 0, 0) is the exact same rotation as (180, 180, 180).