Gizmo bug

It’s possible to reproduce easily a bug on the rotation gizmo, surely because of the quaternion to euler :

  1. Rotate 90 degrees on the y-axis
  2. Rotate 40 degrees on the z-axis
  3. Change the y-axis rotation manually on the details window.
    You can see the rotation directly change to something not correct.
    This issue is also when you attach one actor to another because the rotaton is transformed to local space.

Hello Alundra,

After reading over your post it appears that you are encountering gimbal lock. I have provided a visual example below to help you understand gimbal lock.

Additional information on quaternion math and spatial rotation can be found here:

There are several methods to get around Gimbal Lock, the easiest would be to rotate the actor along the X axis (yaw) as opposed to the Y axis (pitch). Another (significantly more difficult) would be to manually convert the rotator to a quaternion and then back to a rotator, which should allow you to work through Gimbal Lock and continue rotating correctly. I hope this information helps.

Gimbal locked airplane. When the pitch (green) and yaw (magenta) gimbals become aligned, changes to roll (blue) and yaw apply the same rotation to the airplane.


Make it a great day

Maybe the only way to solve this issue is to track the euler angles and make the quaternion from it.
But only works for the editor because if the user set a quaternion on the actor, then quaternion to euler is called and it’s not safe.
Maybe some editor-only functions on the actor to transform to local space using the stored angles and the gizmo uses these angles too.