How to add a interface function to a multicast delegate?
I want to extend my actors with an event which gets broadcasted by an other actor's multicast event.
For that I made an interface to ensure that the receiving Actor implements the right function with the right signature. The receiving actor just has to register this function to the broadcasting actor's multicast delegate. I know I can use GetAllActorsWithInterface. I don't want to use it because it doesn't perform well with 1000s of actors.
Since the interface is an object I try to use AddUObject but can't get it to work. I just get:
error C2338: You cannot use UObject method delegates with raw pointers.
Hope someone can point me in the right direction.
asked Jun 16 '15 at 06:30 AM in C++ Programming
Unreal engine's interface support is very limited. Either you cast it to the "UObject" class your actor inherits or you make an interface that takes a delegate reference and register it in your actor instead with the "UObject" pointer (i.e. the "this" keyword). The latter is probably the best design.
answered Aug 12 '15 at 11:02 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here