Game Development Reference
In-Depth Information
If you run the demo now, you will see the ship moving with the sensor (in Editor
View ). The ship with a visual sensor should look like the following image:
This completes setting up the sensor for our ship.
Changing activities based on sensing
We now have the ship sensing the gold as it passes by, but it still doesn't react to it.
To do this, we will update the behavior tree for the ship.
The first thing we want is a detect node as the ship is moving so it can know if it sees
Gold . Open the behavior tree for the ship and create a detect node. As the detect
node will be running continuously, change its Repeat type to Forever and right-click
on the root node and change its type to Parallel . For the detection part of the detect
node to work, set the Aspect field to "Gold" and set the sensor it will be using to
"Visual Sensor ". Finally, we need to set the form of the aspect, the game object at-
tached. Set Form Variable to gold .
Search WWH ::




Custom Search