C++ enum instances are very useful in typical C++ code. UE4 has a custom type of enumeration called UENUM(), which allows you to create an enum that will show up in a drop-down menu inside a blueprint that you are editing.
Creating a UENUM( )
How to do it...
- Go to the header file that will use the UENUM() you are specifying, or create a
file called EnumName.h. - Use the following code:
UENUM() enum Status { Stopped UMETA(DisplayName = "Stopped"), Moving UMETA(DisplayName = "Moving"), Attacking UMETA(DisplayName = "Attacking"), };
- Use your UENUM() in a UCLASS(), as follows:
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category =
Status) TEnumAsByte<Status> status...