# Event Dispatcher only firing on self

**URL:** <https://forums.unrealengine.com/t/event-dispatcher-only-firing-on-self/1340395>\
**Category:** Blueprint\
**Tags:** event-dispatcher, unreal-engine, Blueprint, question\
**Created:** [October 22, 2023, 3:20am UTC](https://forums.unrealengine.com/t/event-dispatcher-only-firing-on-self/1340395 "2023-10-22T03:20:28Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![Zapking9224](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/zapking9224/32/1060813_2.png) [@Zapking9224](https://forums.unrealengine.com/u/Zapking9224)\
**Post date:** [October 22, 2023, 3:20am UTC](https://forums.unrealengine.com/t/event-dispatcher-only-firing-on-self/1340395/1 "2023-10-22T03:20:28Z")

</div>

Hi,  
So I’m working on a vendor system and I wanted to grey out and make some of the text red when the player cannot afford the item. Each item is in a slot and fills up a grid in another widget. I made a dispatcher and binded an event to check the player’s price and update the opacity and colors of the slot. The problem is that it only updates the slot that the player recently clicked on because I fire the dispatcher each time a payment is made. Any ideas as to why this is happening?

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/7/e/37e114f9e9ac7c0b016eb359ca871c5d50f4824a.png)  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/6/c/c6cdff1a1c8b1c739132bf3ccfcf955c5bbf47bb.png)

The second image shows the binding off the pre construct

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [October 22, 2023, 7:29am UTC](https://forums.unrealengine.com/t/event-dispatcher-only-firing-on-self/1340395/2 "2023-10-22T07:29:02Z")

</div>

You’re making a call on a blueprint interface. That will not trigger a dispatcher.

Also, no point in using an interface for the object to talk to itself.

In fact, if it’s all happening inside the same widget, just use a custom event 🙂

---

<div class="post-metadata">

**Author:** ![Zapking9224](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/zapking9224/32/1060813_2.png) [@Zapking9224](https://forums.unrealengine.com/u/Zapking9224)\
**Post date:** [October 22, 2023, 7:30am UTC](https://forums.unrealengine.com/t/event-dispatcher-only-firing-on-self/1340395/3 "2023-10-22T07:30:23Z")

</div>

So that’s what I was wondering. If I use a custom event, how do I make sure that the slot itself and all of its “siblings” also run that event?

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [October 22, 2023, 7:32am UTC](https://forums.unrealengine.com/t/event-dispatcher-only-firing-on-self/1340395/4 "2023-10-22T07:32:15Z")

</div>

Ah, now that’s different 🙂

If you want a kind of ‘all siblings triggered’ scenario, then you need a custom event in the main widget, which each of the siblings binds to on construct.

---

<div class="post-metadata">

**Author:** ![Zapking9224](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/zapking9224/32/1060813_2.png) [@Zapking9224](https://forums.unrealengine.com/u/Zapking9224)\
**Post date:** [October 22, 2023, 7:35am UTC](https://forums.unrealengine.com/t/event-dispatcher-only-firing-on-self/1340395/5 "2023-10-22T07:35:58Z")

</div>

Does binding them on construct in their own class not work? Because when I stepped through the code, they were all binded. But when I click the button to by an item, only the button that was clicked runs the dispatcher and the siblins aren’t triggered even though they are bound to the event

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [October 22, 2023, 7:38am UTC](https://forums.unrealengine.com/t/event-dispatcher-only-firing-on-self/1340395/6 "2023-10-22T07:38:18Z")

</div>

To bind, the object they’re binding to needs to exist at that time. Is that the case?

---

<div class="post-metadata">

**Author:** ![Zapking9224](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/zapking9224/32/1060813_2.png) [@Zapking9224](https://forums.unrealengine.com/u/Zapking9224)\
**Post date:** [October 22, 2023, 7:41am UTC](https://forums.unrealengine.com/t/event-dispatcher-only-firing-on-self/1340395/7 "2023-10-22T07:41:55Z")

</div>

Hmm ok, I think I see what you’re saying. It creates a widget each time so I guess some of them don’t exist yet to be able to bind.

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [October 22, 2023, 7:44am UTC](https://forums.unrealengine.com/t/event-dispatcher-only-firing-on-self/1340395/8 "2023-10-22T07:44:56Z")

</div>

You could just use ‘get all widgets of class’ to find them and just send the signal to all of them, from the custom event.

It’s absolutely fine with a few buttons, people get neurotic about not using ‘get’ nodes, but they’re fine in this sort of case. Even just for testing…

---

<div class="post-metadata">

**Author:** ![Zapking9224](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/zapking9224/32/1060813_2.png) [@Zapking9224](https://forums.unrealengine.com/u/Zapking9224)\
**Post date:** [October 22, 2023, 7:46am UTC](https://forums.unrealengine.com/t/event-dispatcher-only-firing-on-self/1340395/9 "2023-10-22T07:46:05Z")

</div>

That makes sense. I had that idea in the back of my head. But I was hoping there would be a cleaner way or more performant way with dispatchers.

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [October 22, 2023, 7:47am UTC](https://forums.unrealengine.com/t/event-dispatcher-only-firing-on-self/1340395/10 "2023-10-22T07:47:20Z")

</div>

Trouble is with dispatchers, you have to bind every time. That’s probably as bad as using ‘get’ 🙂

---

<div class="post-metadata">

**Author:** ![Zapking9224](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/zapking9224/32/1060813_2.png) [@Zapking9224](https://forums.unrealengine.com/u/Zapking9224)\
**Post date:** [October 22, 2023, 7:49am UTC](https://forums.unrealengine.com/t/event-dispatcher-only-firing-on-self/1340395/11 "2023-10-22T07:49:33Z")

</div>

Well I guess as long as it works, that’s what matters haha.

---

<div class="post-metadata">

**Author:** ![Zapking9224](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/zapking9224/32/1060813_2.png) [@Zapking9224](https://forums.unrealengine.com/u/Zapking9224)\
**Post date:** [October 22, 2023, 8:01am UTC](https://forums.unrealengine.com/t/event-dispatcher-only-firing-on-self/1340395/12 "2023-10-22T08:01:12Z")

</div>

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/9/0/790b28ffc69216a037b15649baa02cf4b469d807.png)  
When I run this get all widgets of class, the outputted array is of size 0. I’m creating the widgets and adding them to a grid slot. Are those not counted as widgets in that node? They are being displayed but that node get all widgets of class isn’t finding any widgets of that class.

---

<div class="post-metadata">

**Author:** ![Zapking9224](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/zapking9224/32/1060813_2.png) [@Zapking9224](https://forums.unrealengine.com/u/Zapking9224)\
**Post date:** [October 22, 2023, 8:06am UTC](https://forums.unrealengine.com/t/event-dispatcher-only-firing-on-self/1340395/13 "2023-10-22T08:06:10Z")

</div>

I can get it to work by doing this but I wasn’t sure if casting would be the best way of doing this. Maybe I could use a blueprint interface as well but I wanted to see if you had any other ideas before I just take that route lol

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/1/e/81ed764703f3d8d3fd457bc2573d546b4824d03d.png)

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [October 22, 2023, 8:21am UTC](https://forums.unrealengine.com/t/event-dispatcher-only-firing-on-self/1340395/14 "2023-10-22T08:21:44Z")

</div>

Yes, you could try an interface instead of casting here. That would be worthwhile, because the child widgets are generic at this point 🙂

---

<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:** [November 21, 2023, 8:21am UTC](https://forums.unrealengine.com/t/event-dispatcher-only-firing-on-self/1340395/15 "2023-11-21T08:21:53Z")

</div>

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