Declaring UFUNCTION with macro

Hi-

I’m wondering- how can I declare UFUNCTIONs using macros?

I write a piece of code that works fine just fine, but putting it in a macro breaks it.
I must be missing something- it always hides the function declared immediately after it and putting it at the end reveals an error:

Putting a semi-colon fixes it (even though it shouldn’t need one), but the function still won’t show up in blueprints.

Substituting out the macro makes everything work perfectly- no errors, no semi-colons, and actually visible to blueprint
image

This is not supported, UFUNCTION and other alike macros are not real macros.
They are parsed by the UnrealHeaderTool which runs as a pre-compile step before preprocessor & compiler.

2 Likes

Ah- that’s really unfortunate…
Copy pasting it is then

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.