how to displaying degrees with float ??
how to show displaying degrees with float, more like compas ?? when i turn 90 degrees, and float will show 90, thanks,,
rotation.jpg
(102.0 kB)
Comment
Best Answer
Answer by AurimasBlazulionis · Jan 11, 2017 at 07:04 PM
It is transform.rotation.eulerAngles.y
. To get the angle, check if it is not less than zero, if it is true, then your angle will be equal to Mathf.Repeat(transform.rotation.eulerAngles.y, 360f)
, else it will be equal to 360f - Mathf.Repeat(transform.rotation.eulerAngles.y, 360f)
.
Your answer
Follow this Question
Related Questions
Adding and subtracting Angle problem 0 Answers
Having trouble rotating around transform.up 0 Answers
Check rotation for a Rigidbody2D 0 Answers
C# Min/Max Rotation based on Float? 1 Answer
gradual ambient light intensity change 2 Answers