When creating a function with parameter type TEnumAsByte it will crash on build. I thought this may have been a migration issue but this happens in an empty project. Anyone else had a crash relating to the Python Plugin? Also I don’t have a D drive…
All Enums should be prefixed with E and Enums should be enum class EButton : uint8
This means that TEnumAsByte, which I don’t think should be used as a parameter anyway is un-necessary, and can be changed to `ReturnTwo(EButton SelectedButton);
Finally, uint8 isn’t a blueprint compatible type as far as I’m aware - you should be using either int32, int, or int64. I could be wrong on that one, however.
Hey - thanks for your help that did it! I think uint8 is blueprint compatible (I’m using the function in a blueprint and it works). I believe that’s the C++ equivalent of a Byte.
I had some trouble getting any Data Assets to show up in a blank project but it imported fine now. Do you know why a Data Asset derived from the C++ class wouldn’t show up as a variable type?
Also, what makes that Enum declaration the old style by the way? Is there a docs file on that?
Fair enough. You might want to just return EButton type and include UENUM(BlueprintType) as well then.
As for the data assets, I can’t remember if they have a UCLASS macro in the header file or something similar, but if they do, you’ll need to ensure that it contains Blueprintable.
I can’t remember where I saw it, but it’s quite common practice now that the new style of enum classes is just better in every way than the namespace method.
I’ve spent 20 hours trying to understand why my project wasn’t launching.
It was because I didn’t put E before my enum type name.
I re-installed the engine. Verified my files multiple times. Watched dozens of tutorials for recovering UE4 corrupt projects. Went line by line in every single one of my C++ classes multiple times trying to figure out what was breaking my game.
I spent an entire day playing around with python coded plugins that ship with UE4.
It was all because I didn’t put an E before my enum type name.