Let's get started by setting up our scene:
- Let's create a few walls to block the line-of-sight from our AI character to the enemy. We make these out of short—but wide—cubes that have been grouped under an empty game object called Obstacles.
- We add a plane as a floor.
- Finally, we add a directional light so that we can see what is going on in our scene.
We represent the player with a tank, similar to what we used in our first example, and we represent the NPCs with simple cubes. We also have a Target object to show us where the tank is moving in our scene. Our scene hierarchy should look similar to the following screenshot:
How our hierarchy is set up
Now, let's position the tank, AI character, and walls randomly around in our scene. Make sure to increase the size of the plane to something that looks good. Fortunately, in this demo, all...