Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Tutorial - Animate Your NavMeshAgents with Root Motion | AI Series Part 42

Discussion in 'Community Learning & Teaching' started by ChrisKurhan, Sep 27, 2022.

  1. ChrisKurhan

    ChrisKurhan

    Joined:
    Dec 28, 2015
    Posts:
    266


    Hey all! Happy #TutorialTuesday!

    Want to use Root Motion to avoid foot sliding with NavMeshAgents? Here's how you can do it with step by step instructions for both 1D and 2D blend tree animated models in AI Series Part 42!

    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!

    In the AI Series (way back at part 3!) I've already covered animating NavMeshAgents, but I covered it the other way - where the Animator is driven by the NavMeshAgent's movement. This works "okay" but there can be noticeable foot sliding and you have to take it a little deeper to get a "good" result by doing things like adjusting playback speed and really tuning the Agent's velocity.

    In today's video I cover how to have the Animator drive the NavMeshAgent, while still allowing the NavMeshAgent to do some things like high level pathing and local avoidance!

    As always, the full project for this video is available on GitHub!
     
    rc82 likes this.
  2. rc82

    rc82

    Joined:
    Jan 28, 2020
    Posts:
    44
    Hey thanks for this! Came.in handy!
     
    ChrisKurhan likes this.
  3. Arbaces

    Arbaces

    Joined:
    Jan 10, 2019
    Posts:
    1
    Excellent video. Many thanks.