UBlackboardComponent::GetValueAsName
#include "BehaviorTree/BlackboardComponent.h"
Access: public
Specifiers: UFUNCTIONBlueprintCallable
Description
Returns the FName value stored under the given blackboard key. Preferred over GetValueAsString for fixed identifier sets like socket names, tag names, or gameplay state IDs.
Caveats & Gotchas
- • Returns NAME_None for a missing key or wrong-type key — indistinguishable from a key deliberately set to NAME_None.
- • Key lookup is by FName every call; cache the FBlackboard::FKey via GetKeyID() for hot-path reads.
- • FName comparisons are fast and case-insensitive, which makes this key type better suited than String for values compared every frame.
Signature
FName GetValueAsName(const FName& KeyName) const Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| KeyName | const FName& | The name of the name blackboard key to read. | — |
Return Type
FName Example
Read a socket name from the blackboard C++
FName SocketName = BlackboardComp->GetValueAsName(TEXT("CoverSocket"));
if (SocketName != NAME_None)
{
MoveToSocket(SocketName);
} Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?