How do I fix rotational axis of an object?

I need to be able to rotate an object cleanly in the x, y, and z directions without rotation in one axis throwing off the rotation in another axis. Here’s an image to illustrate my problem.

The figure on the left is the initial state of the object before rotation. The figure on the right is the state of the object after rotation in the y axis. This rotation has thrown off the z axis.

How do I make the rotate the object independent of its current rotation?

Nim

How are you rotating the object? Sounds like you’re rotating in local space, but would like to be rotating in world space.

If it’s in a script, you can call transform.Rotate() and specify that you’re rotating it in global space (pass Space.World for the relativeTo param).

If it’s in the editor, around the top left of your screen there should be a pair of toggle buttons: pivot/center and global/local. Set the second button to “global”, and your rotations will be performed in world space.

I’m having the exact same problem. transform.roatate (x,y,z,Space.World) works great and keeps all axes aligned to world space. The problem is that there is no equivalent for explicitly setting the rotation while keeping the axes fixed. I’ve tried every flavor of transform.rotation and quaternion rotations. All of them use local axes. (You can say “local” or not all you want. It doesn’t matter. It’s ALWAYS local.)

I think this is a good candidate for an RFE: be able to explicitly set a rotation of an object using the global axes in the exact same way that .rotate uses Space.World. (How Harvester did his Navball without this is mystifying.)