Search Unity

Mixing root motion and in place animations

Discussion in 'Animation' started by Tanbouz, Jan 28, 2014.

  1. Tanbouz

    Tanbouz

    Joined:
    Nov 7, 2013
    Posts:
    8
    I will put my question as an example to make it simpler.

    Example
    Imagine you want to make a cool Idle to Walk starting animation. So now it is Idle -> flip -> walk. Since flip is relatively a complex animation, you base it off root motion. For other reasons you prefer your walk to be based on in place animations.

    The flip root motion will speed up your character from 0 to 1 for example but since the next animation (walk) is an "In place" animation, the transition will blend the velocity back to zero :(

    I tried
    You can set the blending or intersection between the animations to nothing. But then no blending happens between the flip and walk animation in terms of looks. The velocity caused by the root motion stays and you could carry on by switching root motion off anim.applyRootMotion = false; Then the rigid body controller kicks in and applies velocity per player input. But the transition looks jerky.

    Question
    How can I go about doing above example? Keeping both the smooth animation transitions between different animation while carrying over any velocity changes introduced by root motion intact for use by the rigid body controller.

    Do you suggest a different workflow? scrap root motion?

    Thanks!
     
    Radivarig likes this.
  2. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,706
    Or add root motion to Walk. Seems like it would be easier to manage if all clips were consistent.

    Another idea, if you have Pro, is to use animation curves. You could set up a Walk clip with an animation curve that blends back up to 1. You can add the current value of the curve to the velocity.
     
  3. Tanbouz

    Tanbouz

    Joined:
    Nov 7, 2013
    Posts:
    8
    I agree. It is getting messy trying to mix both. Currently leaning on dropping root motion since I will lose fine control of motion using physics and forces.
     
  4. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    15,620
    I think that the animator gives access to the calculated root motion (position and rotation) even if it is not applied. You could try manually applying the calculated motion as you desire, rather than having it automatically applied by the animator.