# Make an event disptacher in GameMode which activates on Confirm\_Button from Widget

**URL:** <https://forums.unrealengine.com/t/make-an-event-disptacher-in-gamemode-which-activates-on-confirm-button-from-widget/1735595>\
**Category:** Programming & Scripting\
**Tags:** custom-event, event-dispatcher, unreal-engine, Widget, question\
**Created:** [March 7, 2024, 9:57am UTC](https://forums.unrealengine.com/t/make-an-event-disptacher-in-gamemode-which-activates-on-confirm-button-from-widget/1735595 "2024-03-07T09:57:29Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![R\_smos](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@R\_smos](https://forums.unrealengine.com/u/R_smos)\
**Post date:** [March 7, 2024, 9:57am UTC](https://forums.unrealengine.com/t/make-an-event-disptacher-in-gamemode-which-activates-on-confirm-button-from-widget/1735595/1 "2024-03-07T09:57:30Z")

</div>

Good day, friends!

I want to create an event dispatcher or somehow to communicate to GameMode that Confirm\_Button in my widget was clicked and to spawn the actors with the variables introduced in widget.

These are the nodes from GameMode

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/2/f/c2f7ead7e13c85dc2d8f94e361d181d5d04bfc03.png)

These are the nodes from Confirm\_Button widget

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/6/3/5634059798cbb48b65ae3124342f1ec954ddf19b.png)

Until now, the Main\_Menu widget (with the Confirm\_Button) was placed in a diferent starting level and OnConfirm would start the Level with it’s logic.

Now I want to leave only one level and for the Widget to be fixed all the time on Viewport (I’ll figure this out).

Only now I can’t make it work as I don’t know how to tell the GameMode to wait until Confirm\_Button is clicked and only after then start working.

Maybe my logic is flawed and I can implement this differently but I would need your help in deciding on that.

Thank you in advance for your help!

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [March 7, 2024, 10:36am UTC](https://forums.unrealengine.com/t/make-an-event-disptacher-in-gamemode-which-activates-on-confirm-button-from-widget/1735595/2 "2024-03-07T10:36:27Z")

</div>

> [@R\_smos](#):
>
> how to tell the GameMode to wait until Confirm\_Button is clicked

- a Custom Event in the Game Mode BP, waiting to be called:

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/6/7/56781ae22e4b72c82e1f0d3e7ed9a470b67f9bd0.png)

- in the widget, the `Confirm` button will call an Event Dispatcher and trigger the Custom Event in the Game Mode:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/a/b/8abb572573acc8bb4d44cf76f17ecd64675656b0.png)

The above is the gist.

* * *

> spawn the actors with the variables introduced in widget.

To expand on this, you can add data pins to the Custom Event and the Dispatcher:

- in the GM, the Custom Event has an additional pin:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/1/a/51adfe4235c8f437c4320c232c45e666216d8bf4.png)

- in the widget:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/8/a/d8a2a536cce261fee02ec9104d8d0662aa4cc0ec.png)

This way you can send any data from the Widget to the Game Mode, and only once the button has been pressed.

---

<div class="post-metadata">

**Author:** ![R\_smos](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@R\_smos](https://forums.unrealengine.com/u/R_smos)\
**Post date:** [March 7, 2024, 11:08am UTC](https://forums.unrealengine.com/t/make-an-event-disptacher-in-gamemode-which-activates-on-confirm-button-from-widget/1735595/3 "2024-03-07T11:08:33Z")

</div>

Thank you very much, @Everynone !

It helped.

The last part wasn’t needed though as the spawn logic was in other funtions and it works great as it is.

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [March 7, 2024, 11:09am UTC](https://forums.unrealengine.com/t/make-an-event-disptacher-in-gamemode-which-activates-on-confirm-button-from-widget/1735595/4 "2024-03-07T11:09:31Z")

</div>

> [@R\_smos](#):
>
> The last part wasn’t needed though as the spawn logic was in other funtions and it works great as it is.

You can also bind it directly to a function, it does not need to be a custom event!

Good luck.

---

<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:** [April 6, 2024, 11:09am UTC](https://forums.unrealengine.com/t/make-an-event-disptacher-in-gamemode-which-activates-on-confirm-button-from-widget/1735595/5 "2024-04-06T11:09:42Z")

</div>

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