O'Reilly logo

Unity AI Game Programming - Second Edition by Thet Naing Swe, Clifford Peters, Aung Sithu Kyaw, Ray Barrera

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 4. Finding Your Way

Obstacle avoidance is a simple behavior for the AI entities to reach a target point. It's important to note that the specific behavior implemented in this chapter is meant to be used for behaviors such as crowd simulation, where the main objective of each agent entity is just to avoid the other agents and reach the target. There's no consideration on what would be the most efficient and shortest path. We'll learn about the A* Pathfinding algorithm in the next section.

In this chapter, we will cover the following topics:

  • Path following and steering
  • A custom A* Pathfinding implementation
  • Unity's built-in NavMesh

Following a path

Paths are usually created by connecting waypoints together. So, we'll set up a simple path, as shown ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required