RealDocs

UBlackboardComponent::CacheBrainComponent

function AIModule Since 4.0
#include "BehaviorTree/BlackboardComponent.h"
Access: public

Description

Stores a pointer to the given brain component so it can be retrieved later via GetBrainComponent, used for communication back to the tree that owns this blackboard.

Caveats & Gotchas

  • Called automatically by UBehaviorTreeComponent when it starts using a blackboard; manual calls are only needed for custom brain implementations.
  • Only a single brain component can be cached at a time — a later call overwrites the previous reference.

Signature

void CacheBrainComponent(UBrainComponent& BrainComponent)

Parameters

Name Type Description Default
BrainComponent UBrainComponent& The brain component (typically a behavior tree component) to associate with this blackboard.

Return Type

void

Example

Associate a custom brain component C++
BlackboardComp->CacheBrainComponent(*MyCustomBrainComponent);

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.