quaternion eular degrees
Hello everone
i use quaternion in my game and rotate my gameobject
for eq:
quaternion.euler(90,0,0);
gameobject rotating and i wan't to come back previous rotation
i use quaiternion.euler(0,0,0);
game object rotating again but i'm looking unity editor gameobject inspector transform value x value not zero it's like 1.366038
why not be zero ?
Check if the number has something like 1.366038 e-09 in the end. That would mean it is basically zero.
you should NEVER! compare floats with zero check if the $$anonymous$$athf.Abs(floatvalue) < $$anonymous$$athf.Epsilon
or more simple: $$anonymous$$athf.Approximately(floatvalue, 0)
Your answer
Follow this Question
Related Questions
GameObject Smooth Movement 0 Answers
X and Z rotating to the same direction using Quaternion.Euler 1 Answer
Locking lean rotation on a motorcycle. 0 Answers
How to set a max rotation angle 1 Answer
limit Quaternion.Euler rotation 2 Answers