Skip to content

Selector

Sam Orme edited this page Feb 20, 2022 · 2 revisions

What is a Selector?

The Selector is a composite node and acts as an OR gate. It will execute each child in order, if the child returns success, the selector will return Success. If the child returns failure, the next child will be executed on the next update.

Example

Simple example of a door selector

.Selector("Selector")
    .Do("Open door", () => {
        ...
      
        return isLocked ? NodeResult.Failure : NodeResult.Success;
    })
    .Do("Break door", () => {
        ...

        return NodeResult.Success;
    })
.End()

Optional Parameters

abortType - see Composite

condition - see Composite

Clone this wiki locally