Game Development Reference
In-Depth Information
The idle behavior
Just in case every other action has failed, the last action in a behavior tree should be
something that can always execute. Behavior trees must find an action to execute regard-
less of the state of the agent. In our case, we simply allow the agent in order to idle at a
place:
function SoldierLogic_BehaviorTree(userData)
...
-- idle action
node = node:GetParent();
node = node:GetParent();
child = CreateAction("idle", IdleAction(userData));
node:AddChild(child);
node = child;
return tree;
end
Search WWH ::




Custom Search