UBlackboardComponent::SetValueAsObject
#include "BehaviorTree/BlackboardComponent.h"
Access: public
Description
Writes a UObject reference to a blackboard key. Decorator observers watching this key will be notified of the change.
Signature
void SetValueAsObject(const FName& KeyName, UObject* ObjectValue) Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| KeyName | const FName& | The name of the blackboard key to write. | — |
| ObjectValue | UObject* | The object to store. Passing null clears the key. | — |
Return Type
void Caveats & Gotchas
- • Writing to a key that doesn't exist in the BlackboardData asset silently does nothing.
- • Passing null is valid and clears the key — decorators checking 'Is Set' will then fail.
- • Triggers any decorator abort requests observing this key on the same frame.
Example
Set a target on the blackboard C++
BlackboardComp->SetValueAsObject(FName("TargetActor"), SensedEnemy); Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?