Gimbal Not So Nimble

Hey there,
I am rotating a transform on a single axis via…

transform.Rotate(Vector3.left, Space.World);

All is working fine, until I stop rotating.

My transform will return a localEulerAngles of (x, 180, 180)

Gimbal Lock. I am catching the case, as I know when there is this occurrence. But when I plug in what should be corrected x,y,z values, and reset the transform to the adjusted values, and tween back to zero, I get the Gimbal Lock Wobbles.

If you were catching a gimbal lock and wanted to correct it, how would you do it?

The question is what are you trying to achieve here? Only knowing that can we suggest a solution.

My simple rule of thumb is that your code should basically never read euler angles back from a Transform and do some conditional logic based on it. What information are you actually trying to glean from reading the euler angles?

Thanks,
I have solved it actually. Just set the 180 axis’ to 0 and set the other to 360 - localEulerAngle.axis.

Thanks