Search Unity

Is it possible to rotate a game object precisely using root motion?

Discussion in 'Animation' started by hannes_unity965, Oct 21, 2020.

  1. hannes_unity965

    hannes_unity965

    Joined:
    Sep 2, 2019
    Posts:
    9
    The amount of rotation gained from an animation's root motion depends on the "Project Settings > Time > Fixed Timestep" value. The lower the value, the more precise the rotation however the more CPU resources used as well.

    Does anyone know, if it is even possible to rotate a game object precisely using root motion?

    For example, when a Mixamo animation has a 180 degree rotation and the "Fixed Timestep" is 0.02, then I get about 99 degrees of rotation (out of a 180 degree animation). When I lower the "Fixed Timestep" to 0.001, then I get about 155 degrees of rotation.

    This question came as a result of debugging this topic: https://forum.unity.com/threads/tur...-idle-animation-without-flipping-back.990263/


    !Slight update!

    It turns out the animation I was using doesn't actually turn 180 degrees after all.

    >facepalm<

    I got a slight rotational gain when turning on
    • "Rigidbody > Interpolate: Interpolate".
    But Unity really did a pretty good job getting the correct rotation out of the animation when setting:
    • "Animator > Update Mode: Animate Physics"
    I am guessing this is slightly more costly on performance than just using a script to rotate your character 180 degrees.
     
    Last edited: Oct 22, 2020