RealDocs

UBlackboardComponent::ClearValue

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

Description

Resets the value stored under the given blackboard key to its type's default/unset state, notifying any registered observers if the value changed.

Caveats & Gotchas

  • Notifies observers only if clearing actually changed the value — clearing an already-empty key is a no-op with no notification.
  • For most types there is no distinct 'unset' sentinel visible through GetValueAs*, so after clearing, reads return the type default (0, false, empty string) rather than something you can detect as 'cleared'.
  • Silently does nothing if KeyName doesn't resolve to a valid key on the blackboard's data asset.

Signature

void ClearValue(const FName& KeyName)

Parameters

Name Type Description Default
KeyName const FName& The name of the blackboard key to clear.

Return Type

void

Example

Clear a target reference when it becomes invalid C++
BlackboardComp->ClearValue(TEXT("TargetActor"));

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.