# Event Dispatchers - I thought I knew how they worked

**URL:** <https://forums.unrealengine.com/t/event-dispatchers-i-thought-i-knew-how-they-worked/1543478>\
**Category:** Blueprint\
**Tags:** event-dispatcher, unreal-engine, question\
**Created:** [December 21, 2023, 5:04pm UTC](https://forums.unrealengine.com/t/event-dispatchers-i-thought-i-knew-how-they-worked/1543478 "2023-12-21T17:04:29Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![blindminds](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/blindminds/32/1213160_2.png) [@blindminds](https://forums.unrealengine.com/u/blindminds)\
**Post date:** [December 21, 2023, 5:04pm UTC](https://forums.unrealengine.com/t/event-dispatchers-i-thought-i-knew-how-they-worked/1543478/1 "2023-12-21T17:04:29Z")

</div>

I am trying to setup a Multiplayer System, with communication between Multiplayer Widget System, HUD and Game Instance and I am not able to get it working. I have used event dispatchers before, so thought I knew what I was doing but not understanding why what I am doing is not working.

I have a multiplayer widget system, where I have a base WBP\_Multiplayer class that ALL of the widgets that are involved with the Multiplayer GUI System are children of. I also handle in the WBP\_Multiplayer base class, binding all of the custom events to associated Event Dispatchers on the HUD\_UI\_MP blueprint.

On the Child Widgets, I then tried to override the parent events that were bound to the HUD\_UI\_MP event dispatcher, so that when the Dispatcher is called from the HUD\_UI\_MP, it should trigger the custom event bound to the dispatcher, and the child widget of parent class of MP\_Multiplayer, would execute code specific to that Widget when the dispatcher is called.

I did this, so that I could make sure all the widgets have the same custom events available to them, as well as a few functions which could then be overridden in the specific widget.

I have a HUD\_UI\_MP blueprint that is child of HUD. This is where I handle communication between Widgets, HUD and Game Instance (GI\_Multiplayer, child of GameInstance). HUD\_UI\_MP has all of the event dispatchers on it (ED\_Login; ED\_Login\_Successful; ED\_Disable\_Login; ED\_Logout; ED\_Logout\_Successful; ED\_Disable\_Login)

If I attach code directly to the event bound to event dispatcher on parent blueprint WBP\_Multiplayer, it will execute that code for each instance, but if I have no code linked in parent to the event bound to event dispatcher, and then try to override parent bound event in the child widget blueprint class, no code will execute.

I have even tried calling a function in the parent widget class WBP\_Multplayer from the event bound to event dispatcher, and then overriding the function in the child widget class, and no code will execute.

Should this not work like this?

I have also tried putting the event dispatchers in the WBP\_Multiplayer parent class. And I have also tried putting the event dispatchers in my WBP\_Sessions class which is a child class of WBP\_Multiplayer, and calling the event dispatchers on the WBP\_Sessions Class from the HUD\_UI\_MP blueprint. I have also tried casting to WBP\_Multiplayer from WBP\_Sessions and calling the dispatcher there and still did not work.

At this point I am dumbfounded and ready to give up. I though I had a thorough understanding of how dispatchers worked, and have used it before with great success, but like 2 years ago.

HUD\_UI\_MP → Show Sessions Widget (Called on HUD\_UI\_MP BeginPlay Event)

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/6/3/163b670cce43d0d97dcfe9e29e6ab9872834b0f8.png)

HUD\_UI\_MP → Login Custom Event Call

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/9/f/19fda7266dca84c1737392f217126aedd5d49481.png)  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/6/1/d611849baf9e94dd3a98dd66295d93e3846f232a.png)

WBP\_Multiplayer

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/c/8/2c87261febb2887cad3d370d4176d4a2174fe88f.jpeg)

WBP\_Login (Child of WBP\_Multiplayer)

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/7/4/f7403e5b408f2a3102ee6e33d71b99f51029ead0.png)

WBP\_Sessions (Child of WBP\_Multiplayer)  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/7/c/a7c90f6b4dc9f402edf975905bfe5ce76c9099da.png)

Result Output

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/3/2/532e38f5ada42370156b7c88818832c1cbe5154f.jpeg)

There should be a bright green print string with Worked! prnted…and nothing

I was trying to set this up so that all the widgets will update using each of their own custom code for that particular event (Disabling Login Button on WBP\_Login for example, after login.

Any thoughts on this? Am I remembering how to use dispatchers incorrectly?

---

<div class="post-metadata">

**Author:** ![Auran131](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Auran131](https://forums.unrealengine.com/u/Auran131)\
**Post date:** [December 22, 2023, 4:23am UTC](https://forums.unrealengine.com/t/event-dispatchers-i-thought-i-knew-how-they-worked/1543478/2 "2023-12-22T04:23:26Z")

</div>

your login event doesnt seem to be replicated, so your server will be calling the event but the client wont recieve it

---

<div class="post-metadata">

**Author:** ![blindminds](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/blindminds/32/1213160_2.png) [@blindminds](https://forums.unrealengine.com/u/blindminds)\
**Post date:** [December 22, 2023, 2:32pm UTC](https://forums.unrealengine.com/t/event-dispatchers-i-thought-i-knew-how-they-worked/1543478/3 "2023-12-22T14:32:06Z")

</div>

This is not a session nor replicated. This is just local user logging into Online Services.  
After the print string says Calling ED\_Login, there should be more print strings from the widgets that have events bound to the event dispatcher ED\_Login.

I have switched to a Blueprint Interface that is implemented in the root class WBP\_Multiplayer in which all multiplayer widgets derive from, and still, I can call the function from the blueprint interface, but only the widget connected to target will fire the event.

Hard to believe I had a good grasp on this 2 years ago, doing complex setups, and now I cant get what i would call a simple setup, to work. ☹

---

<div class="post-metadata">

**Author:** ![Auran131](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Auran131](https://forums.unrealengine.com/u/Auran131)\
**Post date:** [December 22, 2023, 5:28pm UTC](https://forums.unrealengine.com/t/event-dispatchers-i-thought-i-knew-how-they-worked/1543478/4 "2023-12-22T17:28:12Z")

</div>

so whats calling the events and where and when? there is no reason you cant do what your trying but we cant see a lot of information so i have to guess.

its possible you call the event before the bind is set

---

<div class="post-metadata">

**Author:** ![blindminds](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/blindminds/32/1213160_2.png) [@blindminds](https://forums.unrealengine.com/u/blindminds)\
**Post date:** [December 23, 2023, 2:35am UTC](https://forums.unrealengine.com/t/event-dispatchers-i-thought-i-knew-how-they-worked/1543478/5 "2023-12-23T02:35:38Z")

</div>

YESSSS!, That was it, I’m so embarassaed 😉 Thank you!  
At least I think it was…

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/6/5/36572bb78fe689b84b5bb5be60418ef1c1113d89.jpeg)

Still gotta test the dispatchers…

---

<div class="post-metadata">

**Author:** ![blindminds](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/blindminds/32/1213160_2.png) [@blindminds](https://forums.unrealengine.com/u/blindminds)\
**Post date:** [December 23, 2023, 4:58am UTC](https://forums.unrealengine.com/t/event-dispatchers-i-thought-i-knew-how-they-worked/1543478/6 "2023-12-23T04:58:21Z")

</div>

Yes, that was it, now when I call ED\_Login event dispatcher on the WBP\_Sessions Widget (Child of WBP\_Multiplayer), all widgets of class WBP\_Multiplayer will run that Event, if I bind the event on CONSTRUCT instead of INITIALIZE

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/4/e/04e51da7fd2766f5a40024452b8b9a29208ae711.jpeg)

---

<div class="post-metadata">

**Author:** ![blindminds](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/blindminds/32/1213160_2.png) [@blindminds](https://forums.unrealengine.com/u/blindminds)\
**Post date:** [December 23, 2023, 5:24am UTC](https://forums.unrealengine.com/t/event-dispatchers-i-thought-i-knew-how-they-worked/1543478/7 "2023-12-23T05:24:35Z")

</div>

Nope, that was not it. It will execute the code attached directly to bound event in the Parent Class, but if a child overrides the event, the override event never gets called. I also tried having the Parent Class call a Function on itself, then overriding the Function on the Child, and the overridden function will not call ☹

---

<div class="post-metadata">

**Author:** ![blindminds](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/blindminds/32/1213160_2.png) [@blindminds](https://forums.unrealengine.com/u/blindminds)\
**Post date:** [December 23, 2023, 5:32am UTC](https://forums.unrealengine.com/t/event-dispatchers-i-thought-i-knew-how-they-worked/1543478/8 "2023-12-23T05:32:57Z")

</div>

It was half the problem. The other problem, is that overrides on events or functions will not be affected by a bind in the parent class.

I had to Bind Event to ED\_Login on Construct of the Child Class specifically, in order to run code for that specific class.

It would nice nice if overrides would work; but this is still doable for me

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/a/d/9adf23fecc909477598afa75fb082565f3fe2228.jpeg)

---

<div class="post-metadata">

**Author:** ![Auran131](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Auran131](https://forums.unrealengine.com/u/Auran131)\
**Post date:** [December 23, 2023, 8:55am UTC](https://forums.unrealengine.com/t/event-dispatchers-i-thought-i-knew-how-they-worked/1543478/9 "2023-12-23T08:55:51Z")

</div>

hmm that should work, ive done it myself.

i guess you could put the bindings in a function and call the function on child BPs so they manually bind

---

<div class="post-metadata">

**Author:** ![blindminds](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/blindminds/32/1213160_2.png) [@blindminds](https://forums.unrealengine.com/u/blindminds)\
**Post date:** [December 24, 2023, 4:02pm UTC](https://forums.unrealengine.com/t/event-dispatchers-i-thought-i-knew-how-they-worked/1543478/10 "2023-12-24T16:02:27Z")

</div>

Yes, I thought so as well, and since you were of the same opinion I wiped all and redid and got it to work. TL;DR

- Was binding dispatchers before object was available to bind to;
- had binding setup incorrectly - I was calling the ED\_Dispatcher from a different object through the object that had the dispatcher. I changed this so that the Object would first call a custom event on the object that has the event dispatcher, then that custom event calls the event dispatcher on itself (I have not confirmed this is required?)

This is my setup now:  
WBP\_Multiplayer = Base Class for all Mulitplayer UI Widgets  
HUD\_UI\_MP → Handles Communication between game instance and UI MP Widgets  
GI\_Multiplayer → Handles Multiplayer Events

HUD\_UI\_MP creates the Sessions Widget, so it Holds and Sets its reference to the WBP\_Sessions widget, all other widgets can access the HUD via player controllers. Therefore, any WBP\_Multiplayer widget is able to call events from HUD, and HUD then calls events on Parent Widget, and Parent Widget calls Event Dispatcher for all other widgets to execute event.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/5/d/c5d59b63d69160d8b49118287ef39f22dbc86a79.jpeg)  
It is also possible to call the Event Dispatcher Directly from the Blueprint that has it, such as this  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/e/f/5ef8fc29c49ab3056ae384daa3ad853a77e9fd4c.png)

WBP\_Multiplayer Binds the Class Event to the Event Dispatcher (During CONSTRUCT, so that all child widgets will be initialized when parent widget calls construct (ChildWidgets fire events first before parent, parent comes last)

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/7/b/77bb426508a6ab1298b9eea31753d8d5fea36852.jpeg)

WBP\_Sessions is a Child of WBP\_Multiplayer; Contains all UI elements for Multiplayer Sessions (Logins, Errors, Host, Find Sessiosn ect.) and has the Event Dispatchers. Event Init Login is from the Parent Class and calls parent

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/e/0/1e090e25ddd539e626b0158b95ddfb1dd3d8ae25.jpeg)

All the widget elements in WBP\_Sessions, derive from WBP\_Multiplayer, and are able to run the event when called from event dispatcher

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/c/a/2cac45a4854e21bdf85c0a76c86ee94152a14122.png)  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/8/f/b8f9cc2d33ae7d4428ff36bb591b304ae3aa64af.png)  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/c/9/fc925c3f79dd356f848a9442cf0d25d760fbaac2.jpeg)

Hope this helps someone, this makes things sooooooooo much easire for updating the Sessions Widget depending on the situation, as I can just call dispatcher for tat situation, and each widget handles it as needed. Huge time saver!

---

<div class="post-metadata">

**Author:** ![system](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/1/3/713c9d3f58553f0de89543d76a8a3a2779dc9fa4.png) [@system](https://forums.unrealengine.com/u/system)\
**Post date:** [January 23, 2024, 4:03pm UTC](https://forums.unrealengine.com/t/event-dispatchers-i-thought-i-knew-how-they-worked/1543478/11 "2024-01-23T16:03:24Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
