Navigate UMG buttons with gamepad
I'm trying to make a main menu.
Is there any way to select the first button when the game starts?
I'd rather not make players use the mouse in the menu considering that the rest of the game is designed for a controller.
asked Jun 01 '18 at 06:49 PM in Using UE4
You can use SetUserFocus and point to first button in the menu. The problem is when to use it. You can do it on widget construct but using mouse you'll lose that focus. So, if you want to use both mouse, keyboard and gamepad you need to first have a method for detecting the last input change. You can do it using "Any Key Input Event" (remember to untick the input consuming!) and checking for Keyboard, Gamepad or Mouse button. If you detected Gamepad or Keyboard you should reset user focus to first element but only if no other button is currently focused so it can be smooth (mouse could have been laying on another button). So to sum up: 1. Set User Focus on first button when widget is construct 2. Detect input change 3. Reset User Focus to first button if no other button in the menu is focused.
Follow this question
Once you sign in you will be able to subscribe for any updates here