Download

Linking UMG to input from Keyboard

Basically I want to be able to navigate UMG menus using Action mappings. For our current project this is one of the last things we need to do, so if i can do it that way, that would be great. If someone can guide me through this, that would be awesome.

Turn whatever blueprint execution line you want to be fired off in your UMG graph into a custom event/function/whatever works.
In your MyCharacter blueprint, get the input action event for the key press, get the applicable UMG widget and cast the event from the widget to be executed after the input action event.

I’m sorry, I’m a bit confused. How would I create a custom event to navigate through menu items? I don’t know where to do that because I’ve created the custom event at the action mapping and now I’m stuck because I have no idea how to link that to cycling through UMG Menu items. Some more info would be nice.

Hello,
To have a good idea to know how do what Xendran said :
Have a look at the umg quick start guide if you not have do it yet : https://docs.unrealengine.com/latest/INT/Engine/UMG/QuickStart/index.html
Part 4 shows how it works. In your “bind”, You “cast to” your character and drag from it the variable / function / custom event, you want to use in your umg.

Hey Fen,
Thanks for the help. I’ve already been able to cast to my character and create a custom event. Problem is for menu items, I don’t know how to use the event to change the selection of the menu items. An example is basically a title screen with 3 menu items, New Game, Continue, Options. I want to be able to switch between these with the events created by the key presses. How do I do this particular part?

Ok, to switch from a widget to another, you need first to create your widgets and their variables in a hud blueprint.
then, on your bind, you get player controller / get hud and from it drag the variable of the widget you want to open. you “remove from viewport” the actual widget (target “self”) and “add to viewport” the new one dragged from your hud blueprint. Do the same in the other widget and you’ll can go and back.

To go back in game, do a remove actual widget (and don’t forget mouse settings (from player controller) if you have to change them)

Alright, thanks. That seems to be working.