I have an object at point 0,0 and when I moved my mouse to the left side of the screen to rotate the object, transform.localEulerAngles.x is display values such as 359, 358, and etc. I was hoping that it displays -1, -2, and so on.
Language: C#
I have an object at point 0,0 and when I moved my mouse to the left side of the screen to rotate the object, transform.localEulerAngles.x is display values such as 359, 358, and etc. I was hoping that it displays -1, -2, and so on.
Language: C#
If you want to get the negative values for the left side, simply do the following calculations:
float angle = transform.localEulerAngles.x;
angle = (angle > 180) ? angle - 360 : angle;