};
//and i created the function to change the enum to string:
static FORCEINLINE FString GetEnumValueAsString(const FString& Name, TEnum Value)
{
const EStaminaStatus* enumPtr = FindObject(ANY_PACKAGE, *Name, true);
if (!enumPtr) return FString(“Invalid”);
return enumPtr->GetNameByValue((int64)Value).ToString();
}
//this is all in the header file
//now this is the outputlog that should print the current value of the enum in string in begin play function
I want to print out every time a different StaminaStatus. So i do the Log in the tick function and it should print every time the StaminaStatus it has instead of only one specific status
If GetNetMode returns an enum, the enum must probably be a UEnum. Else there is no reason it wouldn’t work. If you have to work with an enum from engine source code which is not a UEnum you could also convert enum to byte or use (TEnumAsByte) to print the byte value in the logger.