Cannot put FOnAttributeChangeData as delegate param or uproperty, even though it works fine in methods

I want to create a multi-cast delegate that has FOnAttributeChangeData as the single param but the log keeps saying "Error: Unable to find ‘class’, ‘delegate’, ‘enum’, or ‘struct’ with name ‘FOnAttributeChangeData’ ", even though the method that also uses the struct as a parameter compiles just fine.

This will work fine

But using it in the delegate will cause "…\Public\GASCharacter.h(12) : Unable to find ‘class’, ‘delegate’, ‘enum’, or ‘struct’ with name ‘FOnAttributeChangeData’ "

Using it in uproperty will also cause "…\Public\GASCharacter.h(24) : Error: Unable to find ‘class’, ‘delegate’, ‘enum’, or ‘struct’ with name ‘FOnAttributeChangeData’ "

Why does the struct FOnAttributeChangeData didn’t work in the delegate or the uproperty even though just one line above it, it worked just fine?

Did you ever get a solution to this? I’m running into a similar (if not exact) problem.

All parameter types of dynamic delegates must be supported by reflection. FOnAttributeChangeData doesn’t have the required macros so it isn’t. Same if you want to use it as a UPROPERTY.

What you can do is wrap the FOnAttributeChangeData in another struct that you expose to reflection. However this may be dangerous since it contains a raw pointer const FGameplayEffectModCallbackData* GEModData; that could easily become dangling. And you’d have to deal with garbage collection of the contained UObject’s.