Skip to content

In this tutorial repository you will learn how to make NavMeshAgents move on a NavMesh with a curved path.

License

Notifications You must be signed in to change notification settings

rontian/ai-series-part-35

 
 

Repository files navigation

Curved NavMeshAgent Paths

In this tutorial repository you will learn how to make NavMeshAgents move on a NavMesh with a curved path.

Generally, when a NavMeshAgent moves along a path they move linearly between the points calculated by NavMesh.CalculatePath via NavMeshAgent.SetDestination, or by your code. We'll use the same concept of calculating a path, then smooth that path using Bezier Curves and postprocess that smoothed path to ensure all the points are still going in the direction the Agent should go, and are still on the path.

To do click-to-move, disable the "Locations" GameObject and enable Click to Move on the SmoothAgentMovement script.

To just compare smoothed paths versus non-smoothed paths, set up the path smoothing configuration you'd like to use on the SmoothAgentMovement script and enable the "Locations" GameObject.

Youtube Tutorial

Patreon Supporters

Have you been getting value out of these tutorials? Do you believe in LlamAcademy's mission of helping everyone make their game dev dream become a reality? Consider becoming a Patreon supporter and get your name added to this list, as well as other cool perks. Head over to https://patreon.com/llamacademy to show your support.

Gold Tier Supporters

  • YOUR NAME HERE!

Silver Tier Supporters

  • Raphael
  • Andrew Bowen
  • Gerald Anderson
  • YOUR NAME HERE!

Bronze Tier Supporters

  • Bastian
  • Trey Briggs
  • AudemKay
  • YOUR NAME HERE!

Other Projects

Interested in other AI Topics in Unity, or other tutorials on Unity in general?

Requirements

  • Requires Unity 2020.3 LTS or higher.

About

In this tutorial repository you will learn how to make NavMeshAgents move on a NavMesh with a curved path.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 100.0%