# Transform rotation BUG with example

I’ve found that a prefab in the scene can lose the correct transform orientations.

I’d appreciate if someone could verify and/or assist in case I’m doing something wrong…

Here is a simple EXAMPLE of the issue. Just follow along step-by step:

1. Create a new scene and place a
simple Unity cube in the scene.

2. In the inspector for the cube, let’s
change the scale of x to 2 and scale
of z to 4, just to break up the
symmetry of the object.

3. Let’s imagine this is an imported object
from an external program and that it
needs to be rotated by 90 deg to get
it oriented correctly in the scene.
So, in the inspector, change the
rotation of x to 270 deg. This cube
is now ready to demonstrate the
problem.

4. Just wiggle the angles
in the inspector and observe the
cube’s motion: wiggle x and it
rotates correctly.

However, wiggling y or z rotates only the z-axis.

Even worse, try rotating the y-axis using the gimbal in the scene view while observing the values in the inspector. Everything goes berserk, and y angle seems to ‘jump’ around.
(BTW You can pick any combo of ‘local/global and center/pivot’ - they have no effect. But if you have the local axis and pivot selected, the rotations should correspond with the coordinate system on screen.)
Try playing with the angles, by setting each angle to 45 deg keeping the rest to 0, or
setting all angles to 45 deg — then wiggle each value observing the result.

It is as if the transform gets corrupted and doesn’t keep all the directions consistently in the correct domain.

Can you reproduce this? Did you find the same problem?

I believe it has something to do with the order in which rotations are being calculated.

It seems it is indeed the rotation order that is responsible for this behavior. The rotation order appears to be zxy, and not xyz.

Hey, I’m experiencing a bug similar to this. When I rotate a gameobject passed -/+90 degrees, the X and Z values go crazy.

Demo of the Bug:

2019, same problem.

1. Exported 4 meshes (A,B,C,D) as an FBX from Blender 2018 with default settings.

2. Imported into Blender.

3. Dragged into Heirarchy

4. Dragged into scene, rotated 180 degrees

5. Dragged from Heirarchy back into Project folder, set to Original Prefab

6. Made A the parent of B; Made D the parent of C.

7. Attempted to recreate an animation I made earlier, but the Y and Z axes each rotate about the same axis. Completely messed up now.

Tried again importing each object as its own FBX. I parented them to an Empty and made that a prefab. I am having the exact same problem now. This is a terrible problem. Please fix this ASAP!

Thought I had a solution, but it didn’t work.