Why i got a -0.01 from Transform.eulerAngles?

When I use Transform.eulerAngles to get the eulerAngles, sometimes I get a -0.01 (z = -0.01 or y = -0.01).

It confuses me a lot, because I always get eulerAngles range from 0 to 360. I’m not sure if other negative number will come, so I want figure it out before it damage our model.

Thank you!

I haven’t found anything in the docs saying about this range. In inspector, however, I can often see values like -90, and I’d assume that the displayed range goes from -180 to 180. Anyway, let’s focus on “damaging your model”. What seems to be the issue? Of course, in euler angles model, the angle 360° would represent the same rotation as 0°, but it might give you different results based on what are you actually doing with the number.

Since the docs say nothing about the range, I’d say that’s what you have to expect, nothing. Simply convert the value to format your “model” expects. For example, you could use Mathf.DeltaAngle(0, eulerAngles.x). This method claims to always return the smallest angle, handling the wrap-around. So even Mathf.DeltaAngle(0, 270) should return -90, giving you the (-180 ; 180> range, though I’d double check especially for the edge cases.