Setting up the scene
In order to get started with implementing the sensing system, you can jump right into the example provided for this chapter, or set up the scene yourself, by following these steps:
- Let's create a few barriers to block the line of sight from our AI character to the tank. 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.
As you can see in the example, there is a target 3D model, which we use for our player, and we represent our AI agent using a simple cube. We will also have a Target
object to show us where the tank will move to in our scene.
For simplicity, our example provides a point light as a child of the Target
so that we can easily see our target destination in the game view. Our scene hierarchy will look similar to the following screenshot after you've set everything up correctly:

The scene hierarchy
Now we will position...