Passing an Enum as Parameter into a UFUNCTION
So I am trying to create a blueprint enabled method with C++ but I am running into a Missing '*' error that is breaking solution.
Now in my base class a am creating the function.
No mater what I do I keep getting "Missing '*' in Expected a pointer type" error. If I remove the UFUNCTION it compiles fine.
I get the same error exactly if I add the *
If I understand correctly you're trying to create a function that can be called inside a blueprint that takes in an Enum as a parameter? Using the Enum you posted and Shadowriver's suggestion I was able to compile a function successfully. I copied your Enum and used Shadowriver's suggestion of removing "class" and "uint8" from the Enum declaration. This was placed outside of the class declaration rather than inside. Inside the class I was able to create the following function which compiled and was usable in the editor:
Let me know if this is the functionality you are trying to achieve or if there is something I've missed about your issue.
answered Oct 07 '15 at 09:15 PM
Reflection system only support specific types, thats why you get error from UHT (not compiler) when you use it with UFUNCTION().
Remove "class" and ": uint8" from enum declaration (reflection system does not support enum classes) and in function place
as well anywhere else when you use enum as varable in reflection system. I'm not sure if you can use Enum inside class, i did that myself and not sure if it's gonna work (it might build with UENUM(), because UHT ignore it thinking it some macro inside class and compiler ignore all reflection macros), if not then move it outside of class
Follow this question
Once you sign in you will be able to subscribe for any updates here