UBlackboardComponent::GetValueAsVector
#include "BehaviorTree/BlackboardComponent.h"
Access: public
Specifiers: UFUNCTIONBlueprintCallable
Description
Returns the FVector stored under the given blackboard key. Commonly used to retrieve patrol destinations, last known positions, or target locations stored by other behavior tree tasks.
Signature
FVector GetValueAsVector(const FName& KeyName) const Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| KeyName | const FName& | The name of the vector blackboard key to read. | — |
Return Type
FVector Caveats & Gotchas
- • Returns FVector::ZeroVector silently for missing keys — a valid patrol point at the world origin would be indistinguishable from a missing key. Use IsVectorValueSet() when this distinction matters.
- • Key lookup is by FName; typos result in silent zero returns. Validate key names during development with a check or ensure().
- • The stored FVector is not automatically updated if the referenced actor moves. Re-write the key via SetValueAsVector whenever the source position changes.
Example
Get a patrol destination C++
FVector Dest = BlackboardComp->GetValueAsVector(TEXT("PatrolTarget"));
MoveToLocation(Dest); Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?