There is an included script called MecanimBridge that you might want to have a look at (check how it is implemented). I’ve wanted to have an example scene for this script for a while, but it turns out it’s tricky to find models and animations that I can actually redistribute with a correct license. And the ones from Unity that I tried weren’t quite what I wanted.
However, when it comes to integrating mecanim, pathfinding and local avoidance I don’t really have a good solution. I have tried a whole range of different approaches over the years, but I haven’t really found one that works satisfyingly. I also mentioned this in a previous thread.
I’ll check it out,
but so far I did have luck with this implementation, it seems to be working so far, I just turned off calculating root motion for the AI characters, and apply the root motion to the max speed.
///Sync AgentSpeed with RootMotion
var desiredSpeed= (Soldier.Animancer.Animator.deltaPosition / Soldier._deltaTime).magnitude;
var newSpeed= Mathf.Lerp(_lastSpeed, desiredSpeed, 0.5f);
_brain._aiPath.maxSpeed = newSpeed;
_lastSpeed = newSpeed;