Download

Strange behaviour of event dispatchers in UMG (possible bug?)

I discovered a strange behaviour of event dispatchers in UMG blkkueprints.

First the setup:

  • I have an actor component blueprint that manages the abilities of my player character. Whenever an ability is added an event dispatcher is called to notify of the change. This component resides in my player state blueprint.
  • Additionally I have a UMG widget that displays said abilities and subscribes to the event dispatcher. If the dispatcher sends an event the widget will update itself to reflect the new state.

Here is the strange thing:
When I tested the event dispatcher with a simple function in my player character blueprint everything worked as expected. However, when I coded the logic in my UMG widget the event bound to the dispatcher didn’t fire. I bound it at “Event Construct”, as I’d expect should be done, since construct is called before everything else. Now, when I put the binding behind a “DoOnce” and link it to “EventTick”, the custom event fires just fine.

Is this the expected behaviour? If so it’d be very different from any other event dispatcher logic in blueprints. If not, could this be a bug?

Here are two screenshots to show in detail what I meant:
BoundInConstruct.jpg
BoundInTick.jpg