RealDocs

UBlackboardComponent::GetRotationFromEntry

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

Description

Resolves a rotation from the given blackboard key, whether it's a Rotator key or an Object/Actor key, and writes it to ResultRotation. Returns false if resolution failed, such as an unset key or a destroyed actor reference.

Caveats & Gotchas

  • Works with both Rotator-type keys and Object-type keys pointing at an Actor, internally extracting the actor's rotation — more forgiving than calling GetValueAsRotator directly against a non-rotator key.
  • Returns false (not a zero rotation) on failure, so always check the return value before trusting ResultRotation.
  • Fails for an Object key whose stored actor has been destroyed, since the underlying object reference resolves to nullptr.

Signature

bool GetRotationFromEntry(const FName& KeyName, FRotator& ResultRotation) const

Parameters

Name Type Description Default
KeyName const FName& The name of the blackboard key to read a rotation from.
ResultRotation FRotator& Out parameter receiving the resolved rotation.

Return Type

bool

Example

Face toward a blackboard-stored rotation C++
FRotator TargetRotation;
if (BlackboardComp->GetRotationFromEntry(TEXT("TargetFacing"), TargetRotation))
{
    AIController->SetControlRotation(TargetRotation);
}

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.