AAIController::UseBlackboard
#include "AIController.h"
Access: public
Specifiers: UFUNCTIONBlueprintCallable
Description
Initializes a Blackboard component on this controller using the specified asset, creating one if it doesn't already exist.
Signature
bool UseBlackboard(UBlackboardData* BlackboardAsset, UBlackboardComponent*& BlackboardComponent) Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| BlackboardAsset | UBlackboardData* | The Blackboard data asset to initialize. | — |
| BlackboardComponent | UBlackboardComponent*& | Output: the Blackboard component that was used or created. | — |
Return Type
bool Caveats & Gotchas
- • If you use RunBehaviorTree(), this is called automatically — you only need UseBlackboard() directly when you want a Blackboard without a full BT (e.g. EQS-only AI).
- • The BlackboardComponent output parameter is populated on success — store it to avoid calling GetBlackboardComponent() repeatedly.
Example
Initialize a blackboard without a behavior tree C++
UBlackboardComponent* BB = nullptr;
if (UseBlackboard(MyBlackboardData, BB))
{
BB->SetValueAsFloat(FName("AlertLevel"), 0.f);
} Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?