Shermans's Notes
Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Back to homepage

Unreal - Enums

Enums

Enum Scoping

  • Never use unscoped enums, as values can clash with predefined eums
    • Use enum class / enum struct instead:
    • I have had a warning that scroped classes only support uint8
1
2
3
4
5
6
7
UENUM(BlueprintType)
enum class ETabBreadcrumb : uint8
{
 None,
 ThingA,
 ThingB
}

Getting the enum name from a value:

  • UEnum::GetValueAsString(value);
    • Returns an FString, so when logging make sure to dereference!
    • UE_LOG(LogCat, LogType, TEXT("This is enum %s"), *UEnum::GetValueAsName(value).ToString())