- Home /
Unity 3 Animation Positioning Problem
I have a throwing object animation, which we worked on inside the unity animation editor.
then in my project I created an empty gameobject and made the animation prefab child of it. this gameobject goes as child of the Main Camera, so that when the player MouseLooks, the arms and object will follow apropriately.
problem is, the animation is a little off the camera to the bottom side. The logical solution would be to get the empty gameobject Y position "higher".
i did that, the game kinda worked, but sometimes the position gets crazy. I noticed that the Inspector is showing me some funky values for position and rotation like this:
-5.549297e-09
does anyone have a clue to what is going on, and more specifically, how to adress this problem?
Answer by Loius · Nov 29, 2012 at 07:27 PM
That isn't (shouldn't be) a problem, it's just float inaccuracy. That number is exactly the same as zero as far as the computer can tell (though if you multiply it hard enough you might eventually get to a non-zero number).
The e indicates scientific notation; the decimal point is actual (09) places left of where it appears in that number. So that's -0.00000000554.
That's a bit odd then... I do agree, it is supposed to be considered as 0, but then again, the animation goes wild and ends up far from the gameobject origin (even though it was zeroed before, too.)
"When" does the position get crazy? Can you replicate it consistently? Is the animation setting the object's position when it shouldn't be? That's usually what's happening.