How to synchronize Mecanim Blend tree animations?

Hi there! I’m working on an adventure game and I’m running into trouble with blend tree animations in Mecanim. I’m using a 1 directional blend tree and my “Direction” parameter controls the animation blending.

You can see a screenshot of my setup but here’s the gist of my threshold setup:

1 running in a circle to the right 0 running straight -1 running in a circle to the left (mirrored)

The problem is that when the character turns, the animations are interpolating between the running straight and the turning, so you get a choppy effect. Here’s a GIF of the problem. I’ve seen unity projects where this has been solved but I still can’t get a sense of how to deal with this problem. Its something I’ve had a problem with for a long time.

When you look at the GIF Notice how the animation is choppy and looks like the character is limping(due to how blend tees work I’m guessing?).

What can I do to get around this problem and create smooth blend tree animations?

If you haven’t already solved - I believe the fix for this is in your animations. The animations have to start out and end on the same foot. So if the character’s last foot forward in the run is his right, on the walk straight, you want the first foot forward to be his right. I think this is correct.
One of the first Unity mecanim videos I watched went into detail about how this helps blending. I might be backwards about the order, but check out the last video in the animation section, called turning your character into a playable character - or something to that effect.

Hope this leads to the solution.

Hi theANMATOR2b! I’m assuming you mean this animation tutorial section? http://unity3d.com/learn/tutorials/topics/animation
I’ll take a look and post any useful info I find.

1 Like

@theANMATOR2b is right, if you want a synchronized blend tree you need to synchronize your animation clip too.

The idea is that all your clip need to begin on the same foot let say right and end on the same right foot. And each clip need to have at least on complete cycle( right foot, left foot, right foot).

So basically you first need to define your synchronize rule. On which foot all clip will begin and end and how many cycle you want. Once you know this you can trim all your clip with those rules and then assemble the synchronize blend tree.

1 Like

Thanks for clarifying Mecanim.dev.
Yes pencilking - sorry I was on mobile when I was replying.
Here is the video I was talking about.