Inside of my Character.h, I have the following code:
UFUNCTION(BlueprintImplementableEvent, meta = (DisplayName = "OnWeaponFire"))
void OnEventFire();
It’s an event that is called from my C++ code like so:
OnEventFire();
It’s picked up in blueprints:
So it works perfectly, and everything is fine. But I want to know how I can execute code in C++ in the same way it is executed in blueprints. So basically, when I call the event inside of my C++ code, it is picked up inside of blueprints and the nodes are executed. When the event is called, I want to be able to listen to it from other C++ classes (or even the same class). When I call “OnEventFire();”, I want another class to be able to execute code if that event is called.
I know I can use delegates, but they’re confusing in the sense that I don’t understand how I can listen for them. I create the delegate, then the signature, and even broadcast it, but I don’t know how I can listen to the event from other classes.