Oh sorry i forgot ^^’ Event functions works only locally because explointing function override, if you no inside the class you can’ override function so you can’t use that. In order to make events that works anywhere you need to create delegate. Delegate decleration needs to be outside of class
//standard delegate only one function can be binded to it, use BindDynamic(...) to bind function
//one bind will replace old one
DECLARE_DYNAMIC_DELEGATE( FSomeDelegate );
//Multi cast delegate can bind multiple functions, use AddDynamic(...) to add function to multicast bind
DECLARE_DYNAMIC_MULTICAST_DELEGATE( FSomeDelegate );
//Delegate can have arguments, by adding "_OneParam"
//for more arguments you use "_TwoParam", "_ThreeParam" and so on
DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParam( FSomeDelegate, ArgType1, ArgName1, ArgType2, ArgName2 );
//Arguments work the same in non-multicast delegate
Now you need to create property with “BlueprintAssignable” to which you will be able to bind functions, use class name which you used in delegate
UPROPERTY(BlueprintAssignable, Category="Somehing")
FSomeDelegate OnSomething;
This alone should let you do external event binds in blueprint now in C++ binding is a little bitty more complex:
OnSomething.AddDynamic(SomeObject, &SomeClass::SomeFunction);
First argument is object in which function is located (use “this” if you want to bind inside the class), 2nd argument is pointer to function that will be called on event. Use BindDymanic() if you use non-multicast delegate, also keep in mind ha binded function arguments need to fit delegate arguments
Now to raise the event you need to call:
OnSomething.Broadcast();
On which all currently binded functions will be called, if you use delegate with arguments you need to input arguments in to Broadcast():
OnSomething.Broadcast(true, 0);
Thats all! ^^ And i still hink you need to add those events inside of base class insted of interface, thats how most classes work in engine
IF you wan some example of delegate use, try looking on engine source code, AActor class got lot of them so search for Actor.h and Actor.cpp