Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Root motion in Mecanim

Discussion in 'Animation' started by christinanorwood, Dec 5, 2013.

  1. christinanorwood

    christinanorwood

    Joined:
    Aug 9, 2013
    Posts:
    402
    I've done some simple animation in Blender in the past. I'm now looking to user Blender models with animation in Unity/Mecanim. The docs say that Unity supports root motion. Does that mean some kind of root bone, or simply an animation where the character actually moves along rather than a walkcycle? I'm just trying to work out the best way to create the animation, not really having had much experience.

    I seem to have got the animations working, mostly.
     
    Last edited: Dec 5, 2013
  2. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    The best description is on Unity's "Root Motion - how it works" page: http://docs.unity3d.com/Documentation/Manual/RootMotion.html

    It checks the movement of the character's center of mass every frame. In practice, animators translate the root bone some variable amount each frame, so that the character moves away from the starting position rather than animating in place.
     
  3. christinanorwood

    christinanorwood

    Joined:
    Aug 9, 2013
    Posts:
    402
    Thanks, I'm slowly working out how it works. I created a simple walk animation in Blender, and an Idle animation, and was able to import both into Unity and eventually use Mecanim to transition from one to the other on the press of a key. Now to figure out how to stop the character walking when I release the key!! The character does actually walk away rather than in place, although I didn't use a specific root bone, just the spine bone which is the parent of the others. It's very basic but I'm pleased with progress so far.
     
  4. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    Sounds like you did everything just right. Check out Unity's Locomotion Starter Kit for a good example of how to set up the transitions and get your character to walk and stop according to keyboard input.