- Home /
90 degrees isnt?
if i type in a rotation of 90 and click off the object, most of the time if i reselect the object it will be either 90.00001 or 89.9999999
- why cant it just be 90?
Answer by Mike 3 · Jul 19, 2010 at 11:28 AM
When you type into the inspector, it changes a quaternion internally via the euler angles you provide
That means that your three numbers get turned into a 4 number object, and then when they're read back, it's giving you as accurate as a float can represent for the object
Basically: it is 90, but float precision isn't accurate enough to keep it exactly there, so you shouldn't worry about it - you'll never notice it
Answer by pyro · Jul 19, 2010 at 11:31 AM
Due to floating point numbers imprecision, 90 isnt always going to exactly equal 90 when converted into a float.
If you are having trouble comparing them you can use Mathf.Approximately(a, b) to compare them to see if they are ALMOST the same.
Your answer
Follow this Question
Related Questions
Help with gun accuracy in degrees. 3 Answers
How to rotate Character depending on the inclination of the platform or its parts? 1 Answer
0-360 Y degree from Vector3.Angle 1 Answer
Rotating A Character 180 Degress 1 Answer
Limit Object Angle 2 Answers