Gamepad/Keyboard navigation in UMG menus?
I'm trying to use UMG for my game menus but my game is suposed to be used with gamepad and I don't know how to bind the keyboard/Gamepad buttons to move along the menus.
In the 4.6 release it is suposed that we can do it:
UI: GAME CONTROLLER SUPPORT
You can now navigate between UI elements using a joystick!
By default you can use the arrow keys, directional pad or left joystick to navigate. You can still use Tab or Shift+Tab as well. This works with both Slate and Unreal Motion Graphics. We’ve unified the concept of “Keyboard Focus” and “Controller Focus” into “User Focus”. Changing user focus will affect all controllers and keyboards for that user.
Am I missing something?
Can someone make a little tutorial on how to achieve this?
I've tried to search documentation about this but i didn't find anything useful for me.
Update: this works with a gamepad as well (tested with an Xbox controller)
I can navigate with keyboard up/down keys using this setup:
Level/character blueprint: in UMG widget (optional, if you want to customize appearance):
The result (it would be nice if we could change the default "dotted line" focused look):
IF set keyboard focus DOESN'T WORK TRY ADDING A DELAY ! FIXED MY PROBLEM
answered Apr 22 '16 at 04:30 PM
To remove the dotted line you can create a class derived from "UGameViewportClient", then you put that class in your DefaultEngine.ini, below [/Script/Engine.Engine] you must add this line "GameViewportClientClassName=/Script/YourGame.YourGameViewportClient". In that class you must overwrite the function
to always return false.
With this, the dotted line should not appear
Sorry I was mistaken on the function to override, this is the good one:
With this, the dotted line will no longer appear.
Tell me if this works for you.
Thx for your solustion .That works for me .
answered Feb 10 '17 at 02:40 AM
Rama Plugin Solution
I made a Gamepad UMG plugin so you can use UMG with a gamepad.
Nick Darnell from Epic wrote the code and I made it into a plugin.
Follow this question
Once you sign in you will be able to subscribe for any updates here