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)

Using senses with RAIN


For this demo, we will use RAIN 2.14 and have a ship that patrols a path, looks for pieces of gold, and picks them up. To start, we'll use a setup similar to that of the demo in Chapter 3, Behavior Trees. You can start from there or recreate it; we just need a ship, a wall, a path, with the ground being a little larger, and the objects spread out a little.

Note

When changing the base geometry of your game levels, you need to regenerate the navigation mesh. This is done by selecting the Navigation Mesh object in your scene and clicking on the Generate NavMesh button.

Here is our basic setup. The following image shows the starting point of our sensor demo:

We also just need the behavior tree for the ship to only patrol the path. Set up this behavior like we did in Chapter 2, Patrolling, or if you are using the behavior tree demo, delete the timer node functionality. The new behavior tree should look like the following screenshot:

This will be the starting point of the behavior...