When I change the angle of an object from an input box that I made, let’s say that I put 180.
the object is only supposed to rotate in the X axis from the transform, so I set it like this:
int ang = int.Parse (angle.GetComponent<InputField> ().text);
TargetPart.localRotation = Quaternion.Euler ( new Vector3( ang,0,0 ) );
but when I look at the transform of the object in the unity UI, the angles are:
x:-5.008956e-06
y:180
z:180
the same happens if I input any angle that is bigger than 90.
Now my problem is:
How can I get the real angle of the object?
If I rotate it to 180 and the transform values changed and aren’t 180, how can I know that it’s 180? because the inputbox then changes the text from 180 to -5.008956e-06 and I need it to display 180 instead of -5.008956e-06
Thanks for your time!