Root Motion NavMeshAgent Animation | AI Series Part 42 | Unity Tutorial @LlamAcademy
Root Motion NavMeshAgent Animation | AI Series Part 42 | Unity Tutorial  @LlamAcademy
Uploaded September 2022 | Updated September 2026, 1 hour ago
Learn how to combine a Root Motion animated model with a NavMeshAgent! This gives you all the pathing benefits and local avoidance of the Navigation System with the precise animation you expect from Root Motion.

Root Motion is a great way to remove that annoying "foot sliding" from mismatched animation vs velocity. But synchronizing that motion with a NavMeshAgent can be tricky! The NavMeshAgent knows where to go and considers local avoidance. So, there's a lot of things to consider when trying to match these two systems!

We've already learned how to animate NavMeshAgents where the NavMeshAgent drives the Animator state (way back in AI Series Part 3: youtu.be/wLZPM46zgUo), but in this video we're going to do it the other way - with the Animator driving the NavMeshAgent!

There are multiple ways to approach this solution. In this repository I have chosen what makes the most sense to me - correcting the position of the Root Motion to pathable areas by moving the position of the model back towards the NavMeshAgent when they are out of sync.

Gargoyle Model used here: assetstore.unity.com/packages/3d/characters/creatures/gargoyles-fantasy-rpg-37416?aid=1101l9QvC
It's not required to run the project, but you will need to use a different model for the Player with 1D animation, or update the "PlayerMovement.cs" to set 2D Animator parameters like it's done in "EnemyMovement.cs".

πŸ”Ά ALL THINGS LlamAcademy now available at: https://llamacademy.dev/support including latest tutorials, courses, ways to support, and more! Check it out πŸ™‚
πŸ‘¨β€πŸ’» Get the FULL FREE PROJECT on GitHub: github.com/llamacademy/ai-series-part-42
🏷️Save 25% on the ultimate C# IDE: JetBrains Rider with code LLAMACADEMY: jetbrains.com/store/?section=personal&billing=yearly

πŸ“š Resources πŸ“š
🟠 Root Motion: docs.unity3d.com/Manual/RootMotion.html
🟠 Synchronizing NavMeshAgents and Root Motion: docs.unity3d.com/Manual/nav-CouplingAnimationAndNavigation.html
🟠 NavMeshAgents and Other Systems: docs.unity3d.com/Manual/nav-MixingComponents.html
🟠 AI Series Part 3 - youtu.be/wLZPM46zgUo

As usual with the AI Series, we're using the NavMesh Components: docs.unity3d.com/Manual/NavMesh-BuildingComponents.html not the built-in navigation system.

Some links may be affiliate links, which at no additional cost to you, gives me a small portion of the purchase.

Chapters:
00:00 Topic Introduction
01:22 3 Keys to Successful Root Motion Animated NavMeshAgents
03:42 Animator Overview - 2D Movement Blend Tree
04:52 Animator Overview - 1D Movement Blend Tree
05:54 NavMeshAgent Configuration
06:58 Why You May Want to Use Root Motion Animation
07:40 PlayerMovement.cs - Prepare Agent and Animator for Root Motion
08:46 PlayerMovement.cs - Synchronize Animator and Agent
09:42 PlayerMovement.cs - Set Animator Parameters
12:26 PlayerMovement.cs - Reconcile Difference in Animation and Agent Positions
13:24 Become a Supporter!
13:56 Demo & Showing Polish Focus Areas
15:21 Final Thoughts
Root Motion NavMeshAgent Animation | AI Series Part 42 | Unity TutorialAnimated 3D Models on the UI with URP | Unity TutorialFade Objects with C# and the Standard URP Shaders | Unity TutorialHow Use Git with Unity! It’s FREE, Easy, and Saves Your Bacon!Procedural Recoil and Bullet Spread | Gun Series 2 | Unity Tutorial #ShortsAccurate Aiming Options Discussed & Implemented | Gun Series 7 | Unity TutorialStatic vs Instances | Unity C# Basics Part 4 #ShortsRead Texture Data from C# Scripts | Unity Tutorial1 Scene INFINITE Levels by Spawning Levels from ScriptableObject Data at Runtime | Unity TutorialBlend Between Textures in a Shader (Vertex Colors) | ShaderGraph  Unity TutorialVisualize a NavMesh, In Game! | AI Series 45 | Unity Tutorial
LlamAcademy |

Root Motion NavMeshAgent Animation | AI Series Part 42 | Unity Tutorial

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER