RealDocs

UBehaviorTreeComponent

class AIModule Since 4.0
#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
Access Type Name
public function UBehaviorTreeComponent::GetActiveNode
public function UBehaviorTreeComponent::GetTaskStatus
public function UBehaviorTreeComponent::IsExecutingBranch
public function UBehaviorTreeComponent::OnTaskFinished
public function UBehaviorTreeComponent::RequestBranchEvaluation
public function UBehaviorTreeComponent::FindInstanceContainingNode
public function UBehaviorTreeComponent::FindTemplateNode
public function UBehaviorTreeComponent::ForEachChildTask
public function UBehaviorTreeComponent::GetActiveInstanceIdx
public function UBehaviorTreeComponent::GetNodeMemory
public function UBehaviorTreeComponent::HandleMessage
public function UBehaviorTreeComponent::IsAbortPending
public function UBehaviorTreeComponent::IsAuxNodeActive
public function UBehaviorTreeComponent::IsRestartPending
public function UBehaviorTreeComponent::ProcessExecutionRequest
public function UBehaviorTreeComponent::RegisterMessageObserver
public function UBehaviorTreeComponent::RegisterParallelTask
public function UBehaviorTreeComponent::RequestBranchActivation
public function UBehaviorTreeComponent::RequestBranchDeactivation
public function UBehaviorTreeComponent::RequestExecution
public function UBehaviorTreeComponent::ScheduleExecutionUpdate
public function UBehaviorTreeComponent::UnregisterAuxNodesInBranch
public function UBehaviorTreeComponent::UnregisterAuxNodesInRange
public function UBehaviorTreeComponent::UnregisterAuxNodesUpTo
public function UBehaviorTreeComponent::UnregisterMessageObserversFrom
public function UBehaviorTreeComponent::UnregisterParallelTask
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

Tags

Version History

Introduced in: 4.0

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.