How do you print an enum value?

Does unreal engine provide a simple way to print enum values as text, or do you have to print them yourself, like with operator overloading and such?

image

const FString Message = UEnum::GetValueAsString(ESomeEnum::SomeValue);

Printing can be done using the log macros, you have to put an * in front of a string variable to make that work.

UE_LOG(LogTemp, Warning, TEXT("The Actor's name is %s"), *YourActor->GetName());

Logging | Unreal Engine Community Wiki

2 Likes

Can you create a enum verb of bp?