Enumertation differences in bp and c++
Hello when creating a BP Enum there are differences in what variable names are allowed compared to a C++ Enum, in my case I want to have the variable names inside the enum be 1, 2, 3, 4, 5 and that's fine for a BP Enum but when trying to do it in a C++ Enum I just get an error. The error is presumably because it isn't allowed but how does the engine parse it and make it work then? What could be my workarounds?
The Enum has numeric names because it is used for handling speed and I know that I could just switch on int but with the Enum I can easily see which values should be allowed and it becomes a lot easier to upkeep.
asked Oct 22 '18 at 02:48 PM in C++ Programming
In pure C++, an enum will have a backing int value like so
With UE4 UEnums, the engine uses metadata to add more details to an enum value (so you can see user friendly names in the editor). This is done like this:
You can grab these values from the UEnum class. Have a look at this wiki for more info
If you want valid numbers for constraint checking with integer values, try using a TSet instead. It would be much faster
answered Oct 22 '18 at 03:18 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here