RealDocs

UBlackboardComponent::GetKeyRawData

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

Description

Returns a raw pointer to the key's value bytes inside the blackboard's internal value buffer, for direct low-level access.

Caveats & Gotchas

  • Returns nullptr if the key name doesn't resolve to a valid key or the value buffer hasn't been allocated yet — always null-check before dereferencing.
  • The pointer is only valid until the next value-buffer reallocation (e.g. changing the blackboard asset); don't cache it across frames.
  • Used internally by the GetValue<T>/SetValue<T> templates and custom UBlackboardKeyType implementations — most gameplay code should use GetValueAsX instead.

Signature

inline uint8* GetKeyRawData(const FName& KeyName)

Parameters

Name Type Description Default
KeyName const FName& Name of the blackboard key.

Return Type

uint8*

Example

Inspecting raw key bytes C++
if (uint8* RawData = BlackboardComp->GetKeyRawData(TEXT("TargetActor")))
{
    // Interpret RawData according to the key's UBlackboardKeyType
}

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.