Fire event in Level Blueprint from Widget


I would like to know how to fire a custom event in a Level Blueprint when I press a button in a Widget

1 Like

you could use an event dispatcher Event Dispatcher - The Basics Of Nodes In Unreal Engine - YouTube

Thanks for the response but I already tried to use event dispatcher.
In My Widget BP I have this:

In my level blueprint I have this:

When I click on the button this part is not working (i only have printed “1” and “disp”)

Also I forgot to mention that I am using a interactive Widget
Here is the blueprint actor I am using to display the widget in game

Hi there,
You have a warning message in your “cast to IWB_StartMainMenu” because this node is not compatible with Player controller. Check your references. Where is your IWB_StartMainMenu being created? Get that reference from the actor who stores it as a variable. Perhaps from BP_PawnBeginMainMenu?

In case you are familiar with Interfaces, I believe Level Blueprints can also implement blueprint interface events.

Yes but the events where not working anymore went i changed my Widget to a “3d” interactive widget

So, you have an actor in your level that creates that 3D widget, correct? Can you show the logic of interacting with this widget? When you press a button, you should be triggering an event that can be sent via interface to anywhere, including the Level Blueprint. Or you can fix that event dispatcher logic, it might work correctly.

@L.F.A I added back my node where the widget is getting created for the first time (iremoved it because i was testing something else).
SO know I have this:

When I start my game I have “disp” and “disp apres” showing, but when I click on the “commencer” button nothing happens

And for your first replay I don’t have any variables

Here is everything that is linked to the 3d widget:
The Widget BP:

The Pawn Actor:

The BP actor Widget:

Correct, these messages will appear only because are connected to the Begin Play wires.
Where did you create the event “Test Dispatcher”?

I first created the event “Test Dispatcher” in the Widget (IWB_StartMainMenu)

I am quite sure you should be using a “widget interaction” component instead of basic “widget”

to be honest I just started creating the 3d widget today, so everything I done is a mix of tutorial from the UE5 docs and YouTube video ^^’

You mean here ?

Correct. You may want to try this one:
WTF Is? Widget Interaction Component in Unreal Engine 4 ( UE4 ) - YouTube

After watching the vidéo I still can’t find how to resolve my problem

This video show how to properly setup a widget interaction. Now let’s get back to your issue. Can you show how is your event dispatcher been triggered inside the widget?

You press btn Commence and call the event dispatcher, correct? Can you show the Level BP?

Is this commence event being fired correctly now? Do you have 1 printed in the screen?

when i “shoot” on the “commence” btn/text i get “1” printed