I wasn’t sure which forum it was best to post this in, as it’s to do with packaging my project. I want to test a packaged build of my project with full blueprint nativization to see what kind of performance benefit we can get from it, but the C++ code generated by the nativization process seems to have an issue.
I have defined an enum in C++ like so:
In the class header, I have an EFactions variable defined as so:
And in one of the blueprint I have this switch placed in the Event Graph:
However, during the nativization process, I get this error:
'static_cast': cannot convert from 'TEnumAsByte<EFactions>' to 'uint8'
Looking at the nativized code and navigating to the offending line, I see this:
b0lK2Node_SwitchEnum_CmpSuccesspf = UKismetMathLibrary::NotEqual_ByteByte(static_cast<uint8>(DefendingFaction), static_cast<uint8>(EFactions::britain));
It looks like it doesn’t like the static cast in this line of code.
Is anyone able to explain why this is happening and how to resolve it? I get it in all blueprints that reference an enum.