Search Unity

Generic mecanim, root motion and mask layers.

Discussion in 'Editor & General Support' started by Arnleif, Dec 11, 2012.

  1. Arnleif


    Sep 27, 2012
    I'm having problem with root motion when applying a masked layer.

    The rig is generic. Root motion in walk anim.

    I move it in script, using the workaround for a know bug where animator.deltaPosition is always 0,0,0:
    void OnAnimatorMove()
    // Because of bug in mecanim with generic rig.
    delta = animator.rootPosition - transform.position;
    agent.velocity = delta / Time.deltaTime;

    All this works fine, but then I added a new layer. Made a bone mask where I only selected the few bone that should be affected. Added 1 animation to this layer. (Bow head down) Looped.

    When I run the game, and drag the weight slider in the layer, the character starts to slow down in forward motion and finally stops as weight reaches 1. The character is now walking on the spot with head down, like expected, but no root motion any more.

    The question is: Have I done something wrong or is this a bug?

    I've also tried adding the same mask (as the one in the layer) to the animation. I've tried baking root motion and not, for my head bow anim. No help. Also checked if animator.deltaPosition maybe had some data now, but no.
  2. pierrepaul


    Unity Technologies

    Jun 19, 2012

    This is definitively a bug. We have identified and fixed it. It will be available in a later release!

  3. Hernan13


    Feb 22, 2013
    Any idea when this bug will be fixed? I have the same problem as described - no root motion for a generic rig after giving a layer weight (the layer does not include the root node).