1

I'm implementing controller navigation in my settings menu and

I've set up a bunch of options with buttons that you can choose from by pressing left/right while the button is selected.

Options

Applying the options is handled by WestButton (square) on the controller.

Current behaviour: When pressing Submit, the highlight disappears completely and the BaseEventData's SelectedObject nulls out, leaving no button selected, breaking navigation completely.

Intended behaviour: When pressing Submit, I want nothing to happen, and the selected button to remain selected, so the user can still cycle left/right to change the option. Turning off button.interactable is not a solution for this case.

I also tried:

  • setting up the options with Selectables instead of Buttons but the exact same thing happens
  • setting up event triggers on the Buttons/Selectables that do Selectable.Select/Button.Select on Submit to no avail
  • making a new Action Map where I removed the "Submit" key bindings, but it breaks navigation too, when I swap it out on runtime, despite it being a complete duplicate of the original Action Map
  • Disabling the "Submit" value in my InputSystemUIInputModule to no avail InputSystemUIInputModule

Any ideas please? Thank you for your time.

2 Answers2

0

If you wanted to your button to be pressed only once then make it button.intractable=false or use this

Udhaya
  • 335
  • 3
  • 12
  • I dont want the button to be press-able even once. The intended behaviour is that you cycle left/right to change the settings, and when you press Submit, nothing should happen because I have another button that handles applying the changes. Turning `button.interactable` off is not a solution in this case, since it'd make cycling left/right impossible, because the button would become non-selectable. – The Embraced One Sep 28 '20 at 10:07
0

I cant explain how, but "Deselect on Background Click" was the reason for this not working, despite my project only being set up to exclusively work with gamepad input, so no mouse input could interfere. Disabling "Deselect on Background Click" solved the issue.