Search Unity

Root motion works properly in preview window but not in game and blend tree preview

Discussion in 'Animation' started by Zwer99, Apr 19, 2017.

  1. Zwer99

    Zwer99

    Joined:
    Oct 24, 2013
    Posts:
    24
    Hello :)

    We have a strange problem: we use root motion for our enemy and created a side walk animation for it. Within the preview window of the FBX-Importer the animation looks great:



    But if we use the animation in a blend tree, the enemy slides on the ground:


    During runtime it has the same issue as in the blend tree preview. We also tried to not use blend trees but "normal" states... same problem.

    Though the strangest thing is that root motion works for all other animations for this character. So Idle, Walk and Run animations are working as expected.

    Also we don't think that this is caused by an blending error of the root motion, because we set the blend values like this (there should be no blending):



    Has anybody an idea what the problem could be?

    Thanks for your help and have a nice day,
    Severin
     
  2. DavidGeoffroy

    DavidGeoffroy

    Unity Technologies

    Joined:
    Sep 9, 2014
    Posts:
    289
    What kind of blend tree are you using?
     
  3. Zwer99

    Zwer99

    Joined:
    Oct 24, 2013
    Posts:
    24
    I'm using a "2D Freeform Directional" Blend-Tree
     
  4. DavidGeoffroy

    DavidGeoffroy

    Unity Technologies

    Joined:
    Sep 9, 2014
    Posts:
    289
    Hmmm...make sure your animation clip has 100% of the weight (as much as you can; one way would be to try it out in a simpler, 1D blend tree)

    If you can't figure it out, or your root motion is still wrong in a case where you're sure your clip has 100% weight, please file a bug.
     
  5. Zwer99

    Zwer99

    Joined:
    Oct 24, 2013
    Posts:
    24
    It seems to work when I only use the two Side-Walk-Animations in my blend tree (it doesn't matter if I use a "1D" or a "2D" blend tree).

    But until another animation is added - for example an Idle or a Walk-Animation - then sliding-effect appears again... even when I make sure, that my clip has 100% of weight.

    So this works:




    And this doesn't work:



    May the problem be, that the side walk translates in X whereas the "normal" walk translates in Z?
     
  6. DavidGeoffroy

    DavidGeoffroy

    Unity Technologies

    Joined:
    Sep 9, 2014
    Posts:
    289
    It might be something specific to your character, but without inspecting the data directly, it's hard to tell.
    Please file a bug with your data, and we'll look at it.
     
unityunity