Search Unity

Root motion consistency across models for humanoid animation clips

Discussion in 'Animation' started by softcraftca, Sep 20, 2020.

  1. softcraftca

    softcraftca

    Joined:
    May 16, 2020
    Posts:
    3
    Hello everyone. I'm having difficulties constructing a particular Timeline successfully. Ultimately, what I want is for two arbitrary models (which I'd assign to the Timeline at runtime) to move towards each other and then interact with each other. My plan was to create two Timeline animation tracks (one for each model), add a walking clip (containing Root Motion) to each track, then follow it up with the interaction clip on each.

    I started having problems when I used "Match Offsets to Previous Clip" to position the 2nd clip on each track; I was getting unexpected offsets for the interaction clip. Even more confusingly, I was getting *different* offsets for those clips on each track, even though they were both adjacent to the same walking clip on their respective tracks.

    After much Googling, controlling for variables, and bashing my head against various walls, I've constructed a test scene that shows the fundamental problem I'm experiencing: the same animation clip, when assigned to different models, is producing different amounts of root motion.

    I have a video demonstrating the problem:

    https://imgur.com/a/ORfO9Qs


    Here's what's going on:
    1. I have a single humanoid animation clip, created with UMotion Pro. There's keyframes at Frame 0 to set the model pose. The only other keyframe is at Frame 60, which moves the Root Transform forward (Z axis) by 1 unit. I've named the clip it "Move Forward 1u".
    2. I have 3 different models placed beside each other. Two are assets I bought through the Asset Store, and one is a default from Mixamo. Each came with their own Humanoid avatars. (The Asset Store ones came with their own, and I used Unity's "Create Form This Model" feature for the Mixamo one)
    3. I have spheres to conveniently mark out 1-unit increments.
    4. I have a Timeline with one animation track for each model. Track Offsets is set to "Apply Transform Offsets" for each.
    5. For each Timeline track, I added my clip "Move Forward 1u" to the start of the track. There are no offsets applied.
    6. After this clip on each track, I added a second copy of "Move Forward 1u". I then selected "Match Offsets To Previous Clip"

    In the video, I think click on each of the clips to show the offsets, and I scrub through the timeline to see how the models move.

    I expected that each model, over 120 frames, would move forward to Z=2. (1 unit per clip x 2 clips). I also expected that the offset of the second clip would be Z=1.

    However, I don't see this. Instead I see different offsets for the 2nd clip and different ending positions for each model:
    1. The leftmost (purchased) model has offset Z=1.005832, and moves forward ~2u (to the 3rd sphere). That's close enough to 1u per clip that I wouldn't be concerned, if it was at least consistent.
    2. The centre (also purchased) model has offset Z=0.99355, and moves forward slightly less than 2u. (It's hard to tell from the video as it's very close to 2u, but in the editor you can see that it's slightly behind the leftmost model. It's about 1% difference between these two models.
    3. The right model (from Mixamo) is way off. The Z offset on the 2nd clip is 1.446908, and after 2 clips of animation it's at 3u from the start.

    The problem is even more inconsistent than this stripped-down demo. When I first noticed this on my main project, I was getting differences of about 144% on a model that's roughly the same as my leftmost one above. (They're both using the same FBX file). After I deleted and re-added the model in my prefab, I found that the difference dropped to about 110%. I've seen differences in rates in various applications to the Mixamo model too.

    I don't understand why this is happening. I expect that, if I create an animation that moves a Humanoid model forward 1u, it should move any Humanoid model forward 1u too. If that's not the case, it would mean that I'm stuck creating model-specific animations & timelines for every combination of models I have in my game.