UKismetStringLibrary::Conv_ObjectToString
#include "Kismet/KismetStringLibrary.h"
Access: public
Specifiers: staticBlueprintPureBlueprintAutocast
Description
Converts a UObject reference to a string by calling the object's GetName() method. Backs the 'To String (Object)' Blueprint conversion node.
Caveats & Gotchas
- • Returns the object's internal UObject name (e.g. 'BP_Enemy_C_3'), not a designer-friendly display name or label — for anything user-facing, use GetActorLabel() (editor-only) or a custom display-name property instead.
- • Calling this on a null object returns the string 'None' rather than crashing or returning an empty string, since GetName() on a null pointer is handled via IsValid checks internally in most call paths — but relying on 'None' comparisons instead of explicit IsValid checks makes intent unclear.
Signature
static FString Conv_ObjectToString(class UObject* InObj) Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| InObj | class UObject* | The object to convert. Its GetName() result is used. | — |
Return Type
FString Example
Log an object's internal name C++
UObject* SomeObject = GetOwner();
FString NameText = UKismetStringLibrary::Conv_ObjectToString(SomeObject);
UE_LOG(LogTemp, Log, TEXT("Object: %s"), *NameText); Tags
Version History
Introduced in: unknown
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?