- Home /
Get current Z rotation of transform in degrees
I use the following code to rotate my 2d sprite:
transform.Rotate (Vector3.back * -5f);
The unity editor shows my Z axis rotation in degrees (90, 180, 360 etc.) but If I try checking the transform.rotation.eulerAngles.z
I get a long decimal number like 0.146... I know there must be a property or a bit of math I can do on this value to get the degrees. Any ideas how I can get the rotation in a degree amount?
maybe try transform.localEulerAngles.z
? your method should be returning the degrees around the z axis so I'm not certain why it is not working, does it return a similar decimal '0.146' for all the 90, 180 degrees etc?
Your answer
Follow this Question
Related Questions
Rotating Sprite Stretching Object 1 Answer
2d character, how to limit rotation to z, with character looking left? 0 Answers
make object rotate towards its direction after bounce 1 Answer
Clamp rotation of sprite? 0 Answers
turn fish3d follow mouse 0 Answers