Fire a custom event in a blueprint, from UMG

HI all

Looking for some direction on how i go about firing a custom event in a blueprint, from a UMG - (Button).

In the details panel for the Button, you can set an on-clicked event.
I had an event dispatcher in my function like this:

I can then bind that event in an external blueprint if needed. By casting from the created widget

Already try that. and the cast fails…

Are you creating the widget in this same blueprint?
This works for me

nope… … i start off in the BP calling the umg widget mainmenu and then add to viewport… etc…
Then when you click play button insdie the mainmenu umg widget… i then removed itself and then shows readyscreen umg widget, where i have a final go button which i want then for my custom event inside my BP to trigger…

ah i just see what your doing… i wil try this now…

OK… so i have it not failing now… but the event binding dont seems to be triggering

Can you put a Print String before the CastTo2DSidescrollergame to see whether the bind is working?

Not fully sure what you want me to connect the print string too.

Yep that’s it, I presume the Print string didn’t do anything then?

When you created the ReadyToStart custom event did you click and drag from the red event square on the “BindEvent to ReadyToStart_Clicked” node and then click “Add custom event for dispatcher”?

The print screen… is printing… Yoo

nope when i pulled from the cast. i choose one of these.

15816-untitled-1.jpg

Oh, well in that case the event is triggering. So there must just be a problem with whatever it is actually happening after that

Yep. the print screen even fires after the cast just before the event binding.
but the event bind is not firing.

but i think maybe ive not explained correctly.

All i want is a for custom event to be fired. in my Blueprint when i click play button… in a umg widget, but the widget has nothing to do with the blueprint i want to fire the event in.

Then search for an instance of the “Blueprint” you are after (Search all actors of class), cast it to your “Blueprint” and get it call the event/function that you want to fire.

Yep already tried that. everything i do. fails … surly there’s got to be a way to trigger a event in a blueprint from umg.
UMG for me at the moment is a disappointment. nothing really works, no info about it… wish i started doing the menu the old way in the hud. wouldn’t have all these silly issues.

But, you triggered that Print String from UMG, didn’t you?
I don’t think there is a problem with the event, I think it’s maybe whatever you are trying to do after that point.

OMG… so embarrassing, i had duplicated BP files so not to mess up my original, while testing and of course i was still casting to my original… opps… red face.

Thanks again. seems to working perfect now.

Works fine for me, you must be doing something wrong. Have you binded a function to the on-click event, and are you doing what I described in my last comment inside of the bound function? Images below:

15807-designer+view.png