How can I output the value of an Enum to a log?

For me, this worked:

Enum Declared:

UENUM()
enum EGripState
{
	Open       UMETA(DisplayName = "Stopped"),
	CanGrip    UMETA(DisplayName = "CanGrip"),
	Gripping   UMETA(DisplayName = "Gripping"),
};

Property declared .h

UPROPERTY(BlueprintReadOnly)
	TEnumAsByte<EGripState> GripState;

Logged in .cpp

    UE_LOG(LogTemp, Warning, TEXT("GripState: %i"), GripState);

TEnumAsByte claims to “to store enumeration values as bytes in a type-safe way”:

4 Likes