Why can't I tag a delegate created with DECLARE_EVENT as a UPROPERTY
I have a class I want to add some Events to that are exposed to Blueprints. It looks something like this:
They both produce the same compiler error:
If I comment out the UPROPERTY line, it compiles, but then I can't do anything with it from Blueprint land, as far as I'm aware.
Trying to use DECLARE_MULTICAST_DELEGATE instead produced the same result.
What am I doing wrong here?
asked Jan 08 '16 at 07:21 PM in C++ Programming
If you would like to expose a delegate as a UProperty, you must declare a dynamic delegate instead of a regular one. The macros are similar: DECLARE_DYNAMIC_DELEGATE, DECLARE_DYNAMIC_MULTICAST_DELEGATE, etc. I don't believe events can be exposed as UProperties, but you can accomplish the same thing with delegates (events are just delegates with a restriction on the class which is allowed to broadcast the execution).
You can take a look at some documentation for dynamic delegates here: https://docs.unrealengine.com/latest/INT/Programming/UnrealArchitecture/Delegates/Dynamic/index.html
answered Jan 09 '16 at 03:28 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here