Selectors
Selectors are the first type of nodes that can have children within the behavior tree. A selector can have any number of children, but will only execute the first child that is available for execution. Essentially, selectors act as if
, if…else
, and else
structures within behavior trees. A selector will return true if at least one child node is able to run; otherwise, the selector returns false:
SoldierLogic.lua
:
local function CreateSelector() return BehaviorTreeNode.new( "selector", BehaviorTreeNode.Type.SELECTOR); end