Search Unity

How root motion works?

Discussion in 'Animation' started by dienat, Jul 17, 2019.

  1. dienat

    dienat

    Joined:
    May 27, 2016
    Posts:
    417
    I have a model which walk animation with these settings

    upload_2019-7-17_21-17-51.png

    This confuses me as i thought the Root transform position and rotation parameters in the pic meant the animation had root motion, and the model would move the transform,but it doesnt do it unless you change the "Root Transform" which in that case the character moves and when reach the end of the animation appears in the starting point again when use Loop. Also when i change to Root Transform dissapear the Root Transform position and rotation parameters and just appears the Loop option

    upload_2019-7-17_21-23-44.png

    How can i solve that the root motion appears in the starting point after reaching the end of the animation? in this way root motion is useless for animations with loops, is that correct?
     
  2. User340

    User340

    Joined:
    Feb 28, 2007
    Posts:
    3,001
    There's a checkbox on the Animator "Use Root Motion", turn it on.
     
  3. dienat

    dienat

    Joined:
    May 27, 2016
    Posts:
    417
    I had the OnAnimatorMove and didnt have the option,enabled it and root motion works now, but then what is the purpose of Root Motion Node?
    And how you make it work with navmeshagent? it goes through columns. I have agent.updatePosition = false and in the update i set agent.nextPosition = transform.position; but doesnt work , keeps going through columns when goes back. Also doesnt respect the stoppingDistance, seems logical as is the root motion which moves everything wont respect navmeshagent no matter what i do? then how can i use root motion and navmeshagent? cant be done? there is the option of using agent.velocity with OnAnimatorMove but then navmeshagent doesnt make collision avoidance
     
    Last edited: Jul 18, 2019