ecspresso
    Preparing search index...

    Interface BehaviorTreeComponent

    Runtime behavior tree state stored on each entity.

    The blackboard is typed as object at the component level. Inside tree callbacks, the BehaviorTreeContext<BB> provides typed access to the blackboard via the tree definition's generic. Outside the tree, cast the blackboard to the specific BB type.

    interface BehaviorTreeComponent {
        blackboard: object;
        definition: BehaviorTreeDefinition<Record<string, unknown>>;
        elapsedTime: number;
        nodeState: Float64Array;
        runningNodeIndex: number;
    }
    Index

    Properties

    blackboard: object
    definition: BehaviorTreeDefinition<Record<string, unknown>>
    elapsedTime: number

    Accumulated time (seconds) for cooldown tracking.

    nodeState: Float64Array

    Dense per-node state array (sized to definition.nodeCount). Semantics vary by node type:

    • sequence/selector: child progress index
    • repeat: completed iteration count
    • cooldown: expiry timestamp (elapsedTime when cooldown ends)
    runningNodeIndex: number

    Index of the currently running leaf, or -1 if none.