How to properly insert Engine-Default Enums in FStructs
I'm trying to make an FStruct to facilitate Function Input communication for Tracing. I'm using the instructions from this page:
Here's the .h
However, compiling this produces the following error: "You cannot Use Raw Enum Name as a Type. Instead, use TEnumAsByte or a C++11 Enum Class with Explicit Underlying Type."
If I use
is says illegal use (with reason), and if I use
it says that it TEnumAsByte cannot convert to ETraceTypeQuery. I'm guessing that the proper way is by including it as a C++11 type. How would I include it this way?
When compiling this struct in my 4.20 project the exact combination that worked was this:
Both those enumerations needed to be declared as TEnumAsByte but EDrawDebugTrace is declared differently. Make sure you are including Kismet/KismetSystemLibrary.h.
answered Oct 30 '18 at 07:05 PMBrian Johnstone (suspended)
For anyone that ever stumbles upon this question, the answer is in the following:
Look up at the Enumerator's declaration (visit there respective Class' page on Epic's documentation). If it's an Enumerator declared below c++ 11, it will have a "namespace" tag on it. That declaration is the following
If it is an Enum 11, it will have an UEnum declaration on it. That one is simply
answered Apr 08 '19 at 06:07 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here