RealDocs

UBehaviorTreeComponent::IsInstanceStackEmpty

function AIModule Since 4.0
#include "BehaviorTree/BehaviorTreeComponent.h"
Access: public Specifiers: const

Description

Returns true if the instance stack has no running behavior tree instances — no tree has been started, or the tree has fully stopped and been cleaned up.

Caveats & Gotchas

  • A paused tree (PauseLogic) still has instances on the stack, so this returns false while paused — use IsRunning/IsPaused if you need to distinguish paused from stopped.
  • It's a plain inline check on InstanceStack.Num(), so it's cheap to call every frame if needed.

Signature

bool IsInstanceStackEmpty() const

Return Type

bool

Example

Guarding against acting on a stopped tree C++
if (!BTComponent->IsInstanceStackEmpty())
{
    BTComponent->RequestBranchEvaluation(EBTNodeResult::Succeeded);
}

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.