Game Development Reference
In-Depth Information
tags that you can set on the entities are called aspects , and the two types of aspects
correspond to our two sensor types: visual aspects and audio aspects. So, a typical
workflow to make your AI characters sense the environment is to put Entity com-
ponents on game objects to detect, add aspects to those entities with the different
tags a sensor can detect, and create sensors on your AI characters. We will look at
a demo of this, but first let's discuss sensors in detail.
Advanced visual sensor settings
We've heard stories of people setting up their sensors—especially visual ones—and
starting the game, but nothing happens or it seems to work incorrectly. Configuring
the senses' advanced settings can help avoid issues such as these and make devel-
opment easier.
To see visual sensor settings, add a RAIN AI to a game object and click on the eye
icon, select Visual Sensor from the Add Sensor dropdown, and then click on the
gear icon in the upper-right corner and select Show Advanced Settings . The fol-
lowing screenshot shows the Visual Sensor section in RAIN:
Here are some of the properties of the sensor:
Show Visual / Sensor Color : These are used to show how the sensor will
look in the Unity editor, not in the game.
Is Active : This flag determines whether the sensor is currently trying to
sense aspects in the scene or whether it is disabled.
Sensor Name : This shows the name of the sensor. This is useful when using
the sensor in behavior trees, which we will see in this chapter's demo.
Search WWH ::




Custom Search