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

**URL:** <https://forums.unrealengine.com/t/cannot-put-fonattributechangedata-as-delegate-param-or-uproperty-even-though-it-works-fine-in-methods/883033>\
**Category:** C++\
**Tags:** Gameplay-Attributes, Gameplay-Effects, unreal-engine, Gameplay-Ability-System, CPP, question\
**Created:** [April 10, 2023, 10:32am UTC](https://forums.unrealengine.com/t/cannot-put-fonattributechangedata-as-delegate-param-or-uproperty-even-though-it-works-fine-in-methods/883033 "2023-04-10T10:32:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chocfudges](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Chocfudges](https://forums.unrealengine.com/u/Chocfudges)\
**Post date:** [April 10, 2023, 10:32am UTC](https://forums.unrealengine.com/t/cannot-put-fonattributechangedata-as-delegate-param-or-uproperty-even-though-it-works-fine-in-methods/883033/1 "2023-04-10T10:32:23Z")

</div>

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

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/0/8/f088e56fa847e4ad516b670b3932383f42baa2c8.png)

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

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/9/c/d9ca37ebd859d4248176d1836fde73c6edfdfd0b.png)

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

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/f/1/4f1c903d86653d8884688d7d5e333672044f5e67.png)

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?

---

<div class="post-metadata">

**Author:** ![bsteeletx](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@bsteeletx](https://forums.unrealengine.com/u/bsteeletx)\
**Post date:** [September 4, 2023, 2:14am UTC](https://forums.unrealengine.com/t/cannot-put-fonattributechangedata-as-delegate-param-or-uproperty-even-though-it-works-fine-in-methods/883033/2 "2023-09-04T02:14:11Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![UnrealEverything](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@UnrealEverything](https://forums.unrealengine.com/u/UnrealEverything)\
**Post date:** [September 4, 2023, 5:13am UTC](https://forums.unrealengine.com/t/cannot-put-fonattributechangedata-as-delegate-param-or-uproperty-even-though-it-works-fine-in-methods/883033/3 "2023-09-04T05:13:50Z")

</div>

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.
