Setting up the environment

As our tank uses a NavMeshAgent component to traverse the environment, we need to set up our scene using static game objects for the bake process to work properly, as we learned in Chapter 4, Finding Your Way. The maze is set up in a way so that towers are spread out fairly reasonably and the tank has plenty of space to maneuver around easily. The following screenshot shows the general layout of the maze:

The gauntlet our tank must run through

As you can see, there are seven towers spread out through the maze and a few twists and turns for our tank to break line of sight. In order to avoid having our tank graze the ...

Get Unity 2017 Game AI Programming - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.