- Home /
(unity2020.3) weird behavior by transform.localEulerAngles (i want to get angle exactly in the inspector)
i found some solution (if its greater than 180, subtract 360 from it) but it did not work
check out this video first value is euler angle second value is local euler angle
(Debug.Log(Cam.transform.eulerAngles.x.ToString("f0")
+ "="
+ Cam.transform.localEulerAngles.x.ToString("f0"));
inspector angle and euler angle goes up together upto 90 then suddenly euler angle goes down, and not even negative value so cant even differentiate between if 30' localEulerAngles is from first quadrant or second
and when inspector angle is 180 and above, euler angle becomes 360 ?
so obviously when inspector angle is 179, localEulerAngles is 1, so substracting 360 from it will not give accurate answer
i just want to know, WHY????????????? why would unity do something so horrible, i dont even know how quaternarenion works and now this.
please code me some maths that would help me get angle exactly like in inspector
Your answer
![](https://koobas.hobune.stream/wayback/20220613030823im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
How is the rotation of a Transform converted into a Vector3 in the inspector ? 2 Answers
Rotating an object taking into account the main camera. 0 Answers
localEulerAngles don't seem to work in an equasion 3 Answers
AddTorque stops working when model is vertical 0 Answers
Gameobject rotating weird 0 Answers