I’m trying to understand how to create Enums that I can use in Unreal with C++. I’ve seen documentation that says the correct way to build them is like this:
#include "GroundDirection.generated.h"
UENUM(BlueprintType)
enum GroundDirection
{
DOWN UMETA(DisplayName = "DOWN"),
LEFT UMETA(DisplayName = "LEFT"),
UP UMETA(DisplayName = "UP"),
RIGHT UMETA(DisplayName = "RIGHT")
};
This doesn’t seem right however because I am getting errors in Visual Studio. Specifically it says:
Cannot open source file GroundDirection.generated.h"
So I have a few questions:
-
What am I doing wrong to make it error?
-
How do I add a number value to me enum values? In Java or C# I could do something like this:
public enum GroundDirection {
DOWN = 0, LEFT = 1 , UP = 2, RIGHT = 3
}