R_smos
(R_smos)
March 7, 2024, 9:57am
1
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
These are the nodes from Confirm_Button widget
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!
Everynone
(Everynone)
March 7, 2024, 10:36am
2
a Custom Event in the Game Mode BP, waiting to be called:
in the widget, the Confirm
button will call an Event Dispatcher and trigger the Custom Event in the Game Mode:
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:
This way you can send any data from the Widget to the Game Mode, and only once the button has been pressed.
1 Like
R_smos
(R_smos)
March 7, 2024, 11:08am
3
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.
1 Like
Everynone
(Everynone)
March 7, 2024, 11:09am
4
You can also bind it directly to a function, it does not need to be a custom event!
Good luck.
1 Like
system
(system)
Closed
April 6, 2024, 11:09am
5
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.