In UMG,How to communicate betow second-level menu and level buleprint

I want to know how can communicate betow second-level menu and level buleprint.
For example ,Clicking a button of second-level menu then print a string,but the print function in the level blueprint.

Didn’t anyone know?

Who can help me?

You want to communicate from UMG widget with your level blueprint correct?

Yes! Can you help me?

You’ll need to have the widget fire off a custom event using the event dispatcher, and in your level BP you’ll need to bind that custom event to an event handler in the BP level script to then call the custom function.

I’ve been trying to do this in a few ways, and I think I’m just missing a key step. To get an event dispatcher to link up in the level, it seems like I need an instance of that actor or blueprint placed in the level.

I’m doing the following:

  1. In the widget, creating an event dispatcher: BeingPlayButtonPressed
  2. In the widget, I call BeginPlayButtonPressed on the function bound to a button
  3. The HUD class is where I’m calling all widget creation, so in the HUD class blueprint I:
    3a. Create the ReadyButton widget
    3b. Cast To the ReadyButton widget class using the result of the cast
    3c. Bind Event to BeginPlayButtonPressed

This works in the HUD, which is where I’m creating the widget, but I don’t know how to get the dispatcher to fire into the level, as there’s no existing reference to the widget in the level blueprint.

Any help would be appreciated.