RealDocs

UBlackboardComponent::GetValueAsRotator

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

Description

Returns the FRotator value stored under the given blackboard key. Used to store a facing direction or desired aim rotation as AI state.

Caveats & Gotchas

  • Returns FRotator::ZeroRotator for a missing key or wrong-type key — indistinguishable from a legitimately zero rotation.
  • Unlike vector keys, rotator keys have no IsVectorValueSet-style validity check, so there is no reliable way to tell 'unset' from a zero rotation.
  • Key lookup is by FName every call; cache the key ID via GetKeyID() for hot-path reads.

Signature

FRotator GetValueAsRotator(const FName& KeyName) const

Parameters

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

Return Type

FRotator

Example

Read a desired facing rotation C++
FRotator DesiredFacing = BlackboardComp->GetValueAsRotator(TEXT("DesiredFacing"));
AIController->SetControlRotation(DesiredFacing);

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.