How can I call a custom event from my player on a widget?

There are three ways to solve this.

  1. You can define an Interface for “AddHealth(amount)” and have your UI call that interface function on the player Pawn. As long as the player Pawn actually does “implement interface” on that interface, the function will be called. That function can then invoke the event if you need it to.

  2. You can get the player Pawn, and Cast Object to your specific player pawn class, and then invoke the event directly on that casted object.

  3. You can put an Event Dispatcher in the GUI, and call that dispatcher in the GUI function. Then have whatever sets up the GUI bind the appropriate function on the player Pawn to that Event Dispatcher in the GUI after the GUI is created.