UKismetSystemLibrary::GetDisplayName
#include "Kismet/KismetSystemLibrary.h"
Access: public
Specifiers: staticUFUNCTIONBlueprintPure
Description
Returns a human-readable name for the object, for use as a debugging aid — the actor's editor label for Actors, a readable name for components, or the object name otherwise.
Caveats & Gotchas
- • Behaviour differs between editor and non-editor builds: in editor builds this returns the Actor's editor label (which the level designer can freely rename and is not unique), while in non-editor (packaged) builds it falls back to the actual object name — do not use this to identify an actor, since the value it returns changes between build configurations.
- • Not localized and explicitly not intended for display to end users of a shipped game — it exists purely as a debug aid (per the header comment).
Signature
static FString GetDisplayName(const UObject* Object) Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| Object | const UObject* | The object to get a display-friendly name for. | — |
Return Type
FString Example
Print a friendly name in a debug HUD C++
FString Label = UKismetSystemLibrary::GetDisplayName(TargetActor);
GEngine->AddOnScreenDebugMessage(-1, 2.f, FColor::Yellow, Label); Tags
Version History
Introduced in: unknown
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?