- Home /
The question is answered, right answer was accepted
Rotation Numbers Are Off?
So I didn't know how to word the title, but for some reason, my script thinks transform.localRotation.x is completely different from what my hierarchy thinks. For example, I did a simple debug:
Debug.Log(transform.localRotation.x);
This is in my Update function so it is called every frame. While testing the game, my hierarchy said the transform's x rotation was 270°. Well thanks to my debug, I could see that my script thought it was at -0.7062691°. Has anyone had the same problem, or am I just doing something completely stupid? If anyone can help me understand this, thank you. If not, thank you.
localRotation is a Quaternion with values between -1 and 1. Try transform.eulerAngles.
Yep, you're right. It was a stupid mistake. If you change your comment to an answer, I'll mark it right.