Goal

Use a Selector to express preference: try the best option first and move right only when an option fails.

Tree structure

Order alternatives such as Use Nearby Cover, Move Away from Threat, and Idle Safely from most desirable to most dependable beneath a Selector.

A Selector tries Use Nearby Cover, Move Away from Threat, and Idle Safely in priority order.

How it runs

When an option is valid only under certain conditions, make it a Sequence containing the condition followed by the Action. Each unavailable branch must return Failure so the Selector can try the next one. If Use Nearby Cover remains Running when no cover exists, the Selector never reaches Move Away.

Put an inexpensive, dependable behavior on the far right so the Selector always has a useful final option.

Variations

Use Priority Selector when GetPriority() should calculate the order when traversal starts. Use Utility Selector when GetUtility() should be compared every tick: it can interrupt a Running child when another available child has the highest utility. Use Selector Evaluator for fixed-priority reconsideration, or Conditional Aborts when changing conditions must redirect execution.

Tasks used in this tree

Selector, Sequence, Priority Selector, and Utility Selector.