BTState

Inherits: LimboState

A state node for LimboHSM that hosts a BehaviorTree.

Description

BTState is a LimboState node that manages a BehaviorTree to provide behavior logic for the state. It instantiates and runs the BehaviorTree resource, dispatching a state machine event upon SUCCESS or FAILURE. Event names are customizable through success_event and failure_event. For further details on state machine events, see LimboState.dispatch.

Properties

BehaviorTree

behavior_tree

StringName

failure_event

&"failure"

bool

monitor_performance

false

StringName

success_event

&"success"

Methods

BTInstance

get_bt_instance() const

void

set_scene_root_hint(scene_root: Node)


Property Descriptions

BehaviorTree behavior_tree 🔗

A BehaviorTree resource that defines state behavior.


StringName failure_event = &"failure" 🔗

  • void set_failure_event(value: StringName)

  • StringName get_failure_event()

HSM event that will be dispatched when the behavior tree results in FAILURE. See LimboState.dispatch.


bool monitor_performance = false 🔗

  • void set_monitor_performance(value: bool)

  • bool get_monitor_performance()

If true, adds a performance monitor to “Debugger->Monitors” for each instance of this BTState node.


StringName success_event = &"success" 🔗

  • void set_success_event(value: StringName)

  • StringName get_success_event()

HSM event that will be dispatched when the behavior tree results in SUCCESS. See LimboState.dispatch.


Method Descriptions

BTInstance get_bt_instance() const 🔗

Returns the behavior tree instance.


void set_scene_root_hint(scene_root: Node) 🔗

Sets the Node that will be used as the scene root for the newly instantiated behavior tree. Should be called before the state machine is initialized. This is typically useful when creating BTState nodes dynamically from code.