UFUNCTION(BlueprintNativeEvent)
class UEalondDamageType* GetDamageInfo();
In my interface .h file returns the error:
“Return value must be ‘const’ since ‘UEalondDamageType’ is marked ‘const’”
This class is not marked const anywhere in my code. My only theory is that the function was initially const and the compiler can’t get over it. Any thoughts?
NB. I’d really love it if the return type weren’t const
c preprocessor - Seeing expanded C macros - Stack Overflow
In Visual Studio, you can generate the preprocessor resulted translation unit file. You can go project options, C/C++/Preprocessor and put “Generate Preprocessed File” or “Preprocess to a File” on Yes (or use /P or /EP compiler switch to include line numbers or not).
Try this to see what exactly the macro is putting in your function declaration. If the macro isn’t putting const in there, delete the intermediate, saved, Binaries/Win64 folders and recompile everything in VS. Hopefully this will fix it.
If not this could be because you are in a interface, I would check the ue docs on this, it could be that you can’t use BlueprintNativeEvent in an interface or something.
Thanks bud. I’ll check this out later and post results. Tried regenerating source files and you can definitely use BP native in interfaces. Perhaps UObjects are auto const-ified. Tbc