Book Image

Unity AI Programming Essentials

By : Curtis Bennett
Book Image

Unity AI Programming Essentials

By: Curtis Bennett

Overview of this book

Table of Contents (19 chapters)

Quick Path AI


Quick Path is back again, with built-in capabilities to handle patrol. With its simple approach to AI, only a few straightforward steps are needed to get a scene finished. Here is a breakdown of these steps:

  • Making the world ready for patrol

  • Setting up the patrol script

We'll start by expanding on our world from Chapter 1, Pathfinding the quick path demo. Stretch out a couple of the blocks to make a larger surface area. Then, click on the terrain object (the parent of all the cubes forming the terrain), and in the Inspector, click on the Bake button. You can see what happens next in the following screenshot:

If the Bake function isn't covering all the areas, you'll need to check its grid dimensions. X remains the same in the world space, but Y is actually the Z axis. You might need to increase or decrease these numbers to cover everything in the scene:

Quick Path converts the values of the Y or Z axis values internally. By default, it is set to Y as the Up/Down axis, but you can...