X Rotation at 0 When Upside Down?

Hi all,

I’ve hit two very confusing issues with rotation. To make them clear, I recorded a video showing the problem at the bottom of this post.

Issue 1: If I rotate a pin (The Pin is an empty gameObject containing a Pin_Collider and Pin_Renderer object) around the X axis, the rotation approaches 90 degrees, doesn’t quite get there, and then starts DECREASING, finally reaching zero when the pin is upside down… even though it also shows zero when it’s right-side up!

Issue 2: If I rotate a pin in the Scene view, the pin rotates around the center - but also changes the position of the pin! However, if I rotate the pin by changing values in the Inspector, the pin instead rotates around the bottom of the pin.

These things plague me because I’m really trying to understand how 3D rotations work in Unity. Any help and insights for how/why the above 2 issues are happening is greatly appreciated!

Link:

Thanks!!

Click on the Center button (next to the Global button) to change the transformation editing origin from center to pivot. This should solve issue 2. Not sure about issue 1 though. Maybe clicking the Global button to switch from global to local would help.

Lion, the Center button did indeed fix issue 2! Thanks!

I tried hitting the Global button, but that hasn’t made a difference. To simplify things, I even created a new Cube with nothing on it and tried rotating that around. It acts the same way, so it’s not something weird with my parent/children Objects.

I have, however, made some headway. I’ve found that as soon as the object I’m rotating gets really close to 90, the Y and Z rotations increment downward by 180. Maybe that relates to gimbal lock somehow? But what’s odd is those values don’t return back to their old values if I stop and rotate the cube the other way. Example: Cube starts at 0, 0, 0 XYZ rotation. Rotate it in the X until it’s 89 degrees, Y and Z are still zero. Rotate it 5 more degrees, it’s now like 86 degrees and Y and Z are now -180. But if I now rotate the cube the other direction, say 10 degrees, X rotation has nearly hit 90, started decreasing and is now 84 degrees, and Y and Z rotations are now -360 degrees. Even though I changed my rotation direction, Y and Z still decreased by 180!

Any ideas?

Sorry, not a clue. I’ve always found those rotation figures to be confusing, (e.g. whether they’re in local or global space), but never enough to let that hinder my progress. Because of that, I either type my desired rotation directly into the fields or use angle snapping (ctrl while draging the handles)

Hm. That’s good to know that angle snapping exists, still makes the X rotation behave just plain bizarrely compared to Y and Z. Any Unity devs care to shed some light?