- Home /
Rotate a box 90 degrees with Root Motion
I am a beginner in Unity. I am trying to rotate a 2D box 90 degrees using the animator component with Apply Root Motion option is checked. Reason for that is I need to be able to rotate this box indefinitely and do some stuff with its child objects. I don't want to rotate and track everything in the script.
Problem is that my box does not rotate perfectly, it's always slightly less then 90 degrees. Like it rotates 89.6 degrees or so even though my animation clearly tells it to rotate by 90. When I test the animation in animation timeline, I see a perfect 90 degree animation. (object.transition.z starts at 0 and finishes at 90.) However, when I press play to test it, it's not a perfect 90 degrees. (first rotation for object.transition.z starts at 0 and finishes at 89.0410 or 89.0408, or 89.0405, something random like that)
Can anyone point me in the right direction please. What could be wrong here. Is it because the animation is controlled by curves, when I apply root motion? Or could it be the transitions between my Idle state and Rotate states in my animator?
Your answer
Follow this Question
Related Questions
Unity 2d Animation from spritesheet: How can I move the character according to the animation? 0 Answers
How to do Turn animations with root motion (root bone rotations)? 2 Answers
Animator animates feet in an animation without foot animation 1 Answer
Root Motion with Animations in Unity 2018 0 Answers
Animation stops too early on all keyframes with apply root motion 1 Answer