Easiest way to play via UMG?

Hey guys,

So I’ve been wanting to play a from a button I have in my UMG HUD. Only problem is, I’m really not sure how to do it. I have done plenty of searching. The closest thing I could find was this, and that doesn’t help me as much I’d like.

If anyone would be willing to explain it step-by-step, that would be awesome. I’m still fairly new to UE4, so you’d have to dumb things down for me.

Well…I personally play matinees in my level BP.
So setup a the way u like it and that part is done.

Now. After you drag the into ur level BP u can drag wire and type play. To play ur . :slight_smile:

All ya need to do now is setup a function in the level BP to play the . So in the UMG graph call the function when you press the button.

Hope I helped!

Hi! Thanks for the reply. Playing the isn’t a worry, it’s a case of how would I communicate between the level blueprint and my widget blueprint so that the OnClicked event for my button would play the in my level blueprint, since you of course can’t do that from the widget.

couldn’t you call a custom event through a console command using the "ce " prefix?

29715-customevent_exec_consolecommand.jpg

it seems a little hacky, but it may be the best way, since your widget should not know what level you are in, and your level shouldn’t assume anything about what kind of menu you are using… but then again, if the menu triggers level cutscenes, than maybe that menu belongs as part of the level, like a lever or button that you can walk up to and use, or some volume you could collide with to trigger the cutscene. if that menu option only works for one level, than maybe that menu should live inside that level.

That worked absolutely fine. Thanks a lot! I not too bothered about hacky ways around things. I’m just playing around with the engine more than anything.

Thanks for the advice too. I’ll keep it in mind.

Omni or Warwolf, thank you for your notes so far on this - I am trying to do something similar to this by using a widget button to set off a camera around a scene. Could any of you see so kind as to elaborate a little bit more?

Check my reply here

those are good methods if you want the menu widget to be spawned by the level. another scenario would be a widget spawned by the HUD, where you could use GetAllActorsOfClass of type MatineeActor.

the reason i posted the CE console command trick, is because the question asked for the easiest solution. I normally wouldn’t recommend using console commands to break encapsulation, but it is easy to do it that way.

Basically, +1 to this. I don’t think it was too long after I posted the question that I’d figured that out. The solution is still quick though, so you can get something working super quickly without any effort.