NavMeshAgent - Root Motion (with avoidance)

Hi,

I’ve been struggling with getting a NavMeshAgent with root motion enabled while not breaking obstacle avoidance. I’ve read the Unity document of mixing components, etc. but none of them actually solve the problem.

I am able to get the base agent to work with root motion by using the 2 approaches outlined by the documentation: https://docs.unity3d.com/Manual/nav-MixingComponents.html but again, once root motion works with the agent, by pulling the agent to the transform, it will break obstacle avoidance - specifically with other agents.

The key here seems to be that the animation moves the transform, but the agent needs run it’s simulation and push the velocity changes back to the transform/animation. Sadly it appears no one has solved the problem or at least have never documented it.

I’ve tried every variation of the document possible, including setting the navmeshagent’s velocity directly. But this usually results in more bugs and behavior issues. The main goal here is the animation moves, and when the agent needs to adjust, it’s position changes are reflected on the transform.

1 Like

Im having nearly same problem, navmesh agent and animation root motion do not go well with each other, i wish unity added some kind of communication between them. Like a component you can attach to character which has both components and solves the problem. Because it’s something that many games would need , especially moba games rely on navmesh and also root motion is very important.