UBehaviorTreeComponent
Inherits: UObjectBase › UObjectBaseUtility › UObject › UActorComponent › UBrainComponent › UBehaviorTreeComponent
#include "BehaviorTree/BehaviorTreeComponent.h" Description
The runtime component that executes a UBehaviorTree asset. Owned by AAIController and responsible for ticking the tree, managing active tasks, and handling aborts.
Caveats & Gotchas
- • You typically do not interact with UBehaviorTreeComponent directly — use AAIController::RunBehaviorTree() and the Blackboard API instead.
- • Accessed via AAIController::GetBrainComponent() cast to UBehaviorTreeComponent if you need low-level control.
- • Stopping the component mid-execution (StopTree()) will abort the active task and clean up the active branch.
Example
Stop a running behavior tree C++
if (UBehaviorTreeComponent* BTC = Cast<UBehaviorTreeComponent>(GetBrainComponent()))
{
BTC->StopTree();
} Functions (49)
Lifecycle 11 ▼
| Access | Type | Name |
|---|---|---|
| public | function | UBehaviorTreeComponent::IsInstanceStackEmpty |
| public | function | UBehaviorTreeComponent::IsPaused |
| public | function | UBehaviorTreeComponent::IsRunning |
| public | function | UBehaviorTreeComponent::RestartTree |
| public | function | UBehaviorTreeComponent::StartTree |
| public | function | UBehaviorTreeComponent::StopTree |
| public | function | UBehaviorTreeComponent::TickComponent |
| public | function | UBehaviorTreeComponent::Cleanup |
| public | function | UBehaviorTreeComponent::GetAccumulatedTickDeltaTime |
| public | function | UBehaviorTreeComponent::ScheduleNextTick |
| public | function | UBehaviorTreeComponent::UninitializeComponent |
Utility 1 ▼
| Access | Type | Name |
|---|---|---|
| public | function | UBehaviorTreeComponent::AddReferencedObjects |
Debugging 6 ▼
| Access | Type | Name |
|---|---|---|
| public | function | UBehaviorTreeComponent::DescribeActiveTasks |
| public | function | UBehaviorTreeComponent::DescribeActiveTrees |
| public | function | UBehaviorTreeComponent::DescribeSelfToVisLog |
| public | function | UBehaviorTreeComponent::EndFrame |
| public | function | UBehaviorTreeComponent::GetDebugInfoString |
| public | function | UBehaviorTreeComponent::SetCSVTickStatName |
Execution 26 ▼
Logic 5 ▼
| Access | Type | Name |
|---|---|---|
| public | function | UBehaviorTreeComponent::AddCooldownTagDuration |
| public | function | UBehaviorTreeComponent::GetCurrentTree |
| public | function | UBehaviorTreeComponent::GetRootTree |
| public | function | UBehaviorTreeComponent::GetTagCooldownEndTime |
| public | function | UBehaviorTreeComponent::SetDynamicSubtree |
See Also
Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?