Game Development Reference
In-Depth Information
We now have an entity with a visual aspect. Create a
Prefab
tab for this
Gold
object
and then add it to the opposite side of the wall as the ship. The scene should look
like the following screenshot:
A sensor demo with gold
Setting up a visual sensor in RAIN
We have the gold aspect; next we need a visual sensor. Select
Ship AI
, click on
the eye icon for the sensors tab, and from the
Add Sensor
dropdown, select
Visu-
al Sensor
. Go to the
Advanced Settings
(selecting the gear icon) icon and adjust
the horizontal and vertical angles as well as the range until the sensor can see a bit
in front of the ship. Typically, you will make these very large so that the character
can see most of the level. For this demo, the sensor values are
120
for
Horizontal
Angle
,
45
for
Vertical Angle
, and
15
for
Range
. Also, check the
Require Line of
Sight
option so that the ship can't see gold through the wall. The setup should look
like the following screenshot: