RealDocs

AActor::GetDebugName

function Engine Since 4.0
#include "GameFramework/Actor.h"
Access: public Specifiers: static

Description

Returns the actor's name as a string, or the literal string "NULL" if the pointer is null. Designed for safe use in log messages and debug output.

Caveats & Gotchas

  • This is a convenience wrapper around `GetName()` that handles null pointers — it does not add any extra information beyond the actor's base `UObject` name. For more context-rich identifiers (class name, net role), use `GetFullName()` or `GetPathName()` instead.
  • The returned name is the `UObject` name, not any display or human-readable name. In PIE, names include auto-generated suffixes like `_C_0`.

Signature

static FString GetDebugName(const AActor* Actor) { return Actor ? Actor->GetName() : TEXT("NULL"); }

Parameters

Name Type Description Default
Actor const AActor* The actor to get the name of. May be null.

Return Type

FString

Example

Safe actor name in a log message C++
void AMySystem::ProcessActor(AActor* Actor)
{
    UE_LOG(LogGame, Log, TEXT("Processing actor: %s"), *AActor::GetDebugName(Actor));
}

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.