x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Navigate UMG buttons with gamepad

I'm trying to make a main menu.
The menu is comprised of two widgets, both of them are focusable. If I try to use the mouse, everything is fine and functional-- I can hover and click and everything.
However, when I try using a gamepad, I cannot see any selector, and the controls don't do anything... until the tab key is pressed.
After pressing tab, there is a selector on the first button. The joystick will move the selector in any direction, across all the buttons on both widgets. Upon pressing the bottom face button, the current button is activated.
If I press tab again, the selector appears to select the whole bigger widget -- there is a faint dotted outline around the whole thing.
If I press tab again, the first button is selected again, and I can navigate happily through all the buttons with the joystick.

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.

Product Version: UE 4.19
Tags:
more ▼

asked Jun 01 '18 at 06:49 PM in Using UE4

avatar image

sonictimm
6 4 2

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

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.

more ▼

answered Jan 10 '19 at 12:31 PM

avatar image

ZimaXXX
244 3 42 18

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question