Need Help: How can I create (Multiple) Enums inside single Cpp. class?

I tried to create a CPP class with multiple Enumerators. But I got across multiple errors and I have no idea how to solve them.


Not to act unprofessional: Don’t tell me “nothing’s wrong” with my code, because the Error List tells for itself.

one problem is UPROPERTY can not be used outside of a class/struct
just making a global UPROPERTY will not work like this

another one is that it looks like the generated.h file has not been created, try rerunning the generate visual studio project files function

small tip on the side, paste the code as preformatted text, easier to read than a screenshot

Kinda figured out how to make Enums on my own.
#include "Engine/Blueprint.h" was missing.
And I didn’t needed UPROPERTY and EnumAsByte to expose this to Variables.

Now… how can I add the Enum from CPP. as a variable to the structure…

you don’t need to include Blueprint.h, and you most definitely shouldn’t include another file’s generated file in a .h

Also, you should use enum class ECndCostumePart : uint8 instead of plain enum

You see, in my case for my cpp Enums, I have to. Otherwise, I get this:

Plus I’m trying to add my Enum to the structure inside my CPP. Just… don’t know how, and I thought adding it to includes of GD_DataRow_CndTalk would be it.


if you have a file with just enums, you cannot include a .generated.h file, since enums don’t have generated files

As far as I know only if a GENERATED_BODY macro is in the document do you need to include the .generated.h file

This works just fine

image
image
image