Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Question Root motion from additive layer not applied

Discussion in 'Animation' started by Zefugi, Jun 21, 2021.

  1. Zefugi

    Zefugi

    Joined:
    Feb 23, 2014
    Posts:
    4
    Hi :)

    I've got a model that is controlled using animations and root motion. I accumulate the deltaPosition and deltaRotation in OnAnimatorMove() and apply it to a Rigidbody in FixedUpdate.

    Everything works fine, until I add animation layers. Then the additive layer doesn't apply to deltaPosition and deltaRotation.

    My setup uses transform animations created in unity and my model does not have bones, so I can't create a mask.

    My test setup is this:
    Layer 0: Simple looping animation that applies +5 to Z axis position.
    Layer 1: Simple looping animation that applies +30 to X axis rotation.

    I've spend two days trying to figure out why I can only have 1 layer affecting the delta values. If I remove the OnAnimatorMove() and check ApplyRootMotion, I get the same problem, but see it visually instead of in Debug, as I get either rotation or movement, but not both.

    Does anyone know what the problem might be?

    I'm using Unity Unity v2021.1.5f1
     
    Last edited: Jun 21, 2021
  2. mgeorgedeveloper

    mgeorgedeveloper

    Joined:
    Jul 10, 2012
    Posts:
    260
    Yes I have this problem too. Driving me nuts. Trying to add a layer that rotates the character using animation (left / right turn). This layer is added on top of the regular character control. Doesn't work with Additive.
     
    Zefugi likes this.
  3. mgeorgedeveloper

    mgeorgedeveloper

    Joined:
    Jul 10, 2012
    Posts:
    260
    Zefugi likes this.
  4. Zefugi

    Zefugi

    Joined:
    Feb 23, 2014
    Posts:
    4
    Well at least that answers it.