Cast from HUD UMG to Level

Hi, what i want to do is next: I have UMG with button on it, clicking on the button should fire some (custom event?) on Level. But neither does custom event nor EventDispatcher works (can’t set them to work, or dont know how).

How to achieve this?

I looked at some answers here and none of them is what i need. Here is mockup of what i actually needs:

This of course doesn’t work. How to make this to work? Or is there any other solution?

I’ve struggled with this as well. Best solution I’ve found so far is to pass these kinds of function requests thru the player controller. This is because the widget is owned by the player controller so its easy to talk that way, and you can get to the player controller from the level blueprint too.

I think the issue is that on the one hand, the level blueprint cant bind to a specific widget because it doesn’t really ‘exist’ until created during run time. And on the other hand, widgets could be used on any map and as far as I can tell there’s no way to call up the current level in BP. Maybe I’m making all this up. But give what I said above a shot, bind a function in the level blueprint to the PC … then call that interim event on the PC that owns the widget.

1l2Hawk is right -

Basically UMG is a component, which isn’t directly inherited by the UWorld. That being said, it works independent of the UWorld. Meaning like other UObjects, its just a component of the UE4 Engine. The difference between Objects & Actors is that actors belong to a World. So without getting to crazy, you can only communicate indirectly using the Actor which owns the UMG object to the world . As pointed out by 1|2Hawk, one is your Player Controller. The PlayerController is inherited by the world, and has world context so it can communicate properly with other components which are inherent of the world.

I could be wrong but that is the gist of it.

Hope that clears up any confusion!

Can you post some blueprint images of how to use player controller the way i wanted to use Event DIspatcher from UMG?

thanks for clarification, also SIlentX thanks for clarification (:

Here is a setup similar to yours with just an Event Dispatcher. Just add an Event Dispatcher on your MyCharacter OR MyController, and assign that to the Level Blueprint Actor.

24572-onuserwidgetblueprint.png

you Sir are awesome! Thank you