Multicast delegate passed as a parameter (C++)

Hi, I have a dynamic multicast delegate declared in c++ and I will like to have a function, callable in blueprint, that takes in this dynamic multicast delegate as a paremeter. However I get this error when i compile.

Error: Type '{multicast delegate type}' is not supported by blueprint

According to this post, it is possible to pass a dynamic delegate as parameter in a function. I have tried it and it works just fine. I will like to know if it is possible to pass a multicast delegate as a parameter into blueprint editor and if it indeed is possible, how can I do it.

Did you find a solution ?

From my tests, I can’t pass a multicast delegate, but i can pass a dynamic delegate as a parameter. This method is not really an answer for my question, but it might help you.

I think I know the solution :-).
You should pass a dynamic (not multi cast) delegate, then extract it’s UFunction
and bind the UFunction to the dynamic multi cast delegate :-B.

1 Like

Exactly what I mentioned. But it does not change the fact that I can’t pass a multicast delegate.

As far as I can figure out, we can pass a dynamic delegate as a parameter and add it to a dynamic multicast delegate in C++. We can also declare the dynamic multicast delegate BlueprintAssignable, so that we can bind it in BP.

As for delegates declared in BP (a.k.a. EventDispatcher), I’m not sure if it can be passed to C++.

I hope with what mentioned in my first paragraph, we can cope with all good design patterns. Maybe UE4 wants us to let C++ take over the delegate if it is used both in C++ and BP.

1 Like