RealDocs

UBlackboardComponent::SetValueAsName

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

Description

Sets the FName value stored under the given blackboard key, notifying any registered observers if the value changed. Preferred over SetValueAsString for fixed identifier sets.

Caveats & Gotchas

  • Silently does nothing if KeyName doesn't resolve to a name-type key on the blackboard's data asset.
  • Setting the same name value again does not re-notify observers, since notifications only fire on an actual change.
  • FName comparisons are case-insensitive, so 'Cover' and 'COVER' are treated as identical values by this key type.

Signature

void SetValueAsName(const FName& KeyName, FName NameValue)

Parameters

Name Type Description Default
KeyName const FName& The name of the name blackboard key to write.
NameValue FName The name value to store under the key.

Return Type

void

Example

Store a cover socket name C++
BlackboardComp->SetValueAsName(TEXT("CoverSocket"), TEXT("Cover_Left"));

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.