Game Development Reference
In-Depth Information
As you can see in the preceding screenshot, recalling the
selector
node works by
going through its children returning on the first success instead of failure. So, after
patrolling is done and the
constraint
node under the selector returns
false
, in-
stead of the tree stopping, the
move
node can be called. If you run the demo now,
everything should work as expected: the ship will patrol for 5 seconds and then
quickly return to the game base as shown:
If you didn't end up with this result, try not to get frustrated. Setting up behavior trees
is pretty precise, and a misnamed variable or wrong node placement will cause in-
terruptions.