BTInstance

Inherits:

Represents a runtime instance of a BehaviorTree resource.

Description

Can be created using the BehaviorTree.instantiate method.

Properties

bool

monitor_performance

false

Methods

Node

get_agent() const

Blackboard

get_blackboard() const

Status

get_last_status() const

Node

get_owner_node() const

BTTask

get_root_task() const

String

get_source_bt_path() const

bool

is_instance_valid() const

void

register_with_debugger()

void

unregister_with_debugger()

Status

update(delta: float)


Signals

freed() 🔗

Emitted when the behavior tree instance is freed. Used by debugger to unregister.


updated(status: int) 🔗

Emitted when the behavior tree instance has finished updating.


Property Descriptions

bool monitor_performance = false 🔗

  • void set_monitor_performance(value: bool)

  • bool get_monitor_performance()

If true, adds a performance monitor for this instance to “Debugger->Monitors” in the editor.


Method Descriptions

Node get_agent() const 🔗

Returns the agent of the behavior tree instance.


Blackboard get_blackboard() const 🔗

Returns the blackboard of the behavior tree instance.


Status get_last_status() const 🔗

Returns the execution status of the last update.


Node get_owner_node() const 🔗

Returns the scene Node that owns this behavior tree instance.


BTTask get_root_task() const 🔗

Returns the root task of the behavior tree instance.


String get_source_bt_path() const 🔗

Returns the file path to the behavior tree resource that was used to create this instance.


bool is_instance_valid() const 🔗

Returns true if the behavior tree instance is properly initialized and can be used.


void register_with_debugger() 🔗

Registers the behavior tree instance with the debugger.


void unregister_with_debugger() 🔗

Unregisters the behavior tree instance from the debugger. This is typically not necessary, as the debugger will automatically unregister the instance when it is freed.


Status update(delta: float) 🔗

Ticks the behavior tree instance and returns its status.