Game Development Reference
In-Depth Information
The check in the preceding screenshot shows the
Constraint
node in action;
however, go ahead and change the value of
donePatrolling
back to false.
Our additional logic for the ship's behavior tree is to return home after 5 seconds of
patrolling. While the ship is patrolling, we want a timer running to 5 seconds. When
the timer is complete, the
donePatrolling
variable will be set to
false
, stopping the
patrol and the ship will start to move back to the
gameBase
navigation point. The
first step for this is to right-click on the root node and navigate to
Switch To
|
Paral-
lel
. Then, create a new sequencer node and add it to the root. The tree should look
like this: