Now we have to get a little bit of setup out of the way to start implementing the topics we've discussed. We need to get our scene ready with environment objects, our agents, and some other items to help us see what the code is doing:
Let's create a few walls to block the line of sight from our AI character to the enemy. These will be short but wide cubes grouped under an empty game object called
Obstacles
.Add a plane to be used as a floor.
Then, we add a directional light so that we can see what is going on in our scene.
We will be going over this next part in detail throughout the chapter, but basically, we will use a simple tank model for our player, and a simple cube for our AI character. We will also have a Target
object to show us where the tank will move to in our scene. Our scene hierarchy will look similar to the following screenshot:
Now we will position the tank, AI character, and walls randomly in our scene. Increase the size of the plane to something...