Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Autoselecting & Navigating In UI SubMenus

Discussion in 'Input System' started by Geejayz, Apr 13, 2022.

  1. Geejayz

    Geejayz

    Joined:
    Feb 8, 2016
    Posts:
    73
    Hi all,

    I'm trying to use the Input System with UI.
    On my main menu page I have multiple buttons and can navigate through these with the gamepad. This required me to set the 'First Selected' field in the Event System component.

    When I click that button using the Gamepad to move to say the options menu, that navigation is lost. Similarly, if I then intervene with the mouse to return back to the main menu, the 'First Selected' option no longer kicks in and I need to select a button with the mouse before I can use the gamepad or keyboard to navigate again.

    Do I need to script this behaviour or am I missing something?
    The same would be true I guess if I paused the game and brought up an in game UI where I would want to navigate again with the controller rather than switching to mouse.

    Is there a Unity Learn Project or existing Unity Project with a functional UI menu that I could dig into for this. The 2D GameKit for example doesn't seem to support gamepad input but I was able to extract some other usefulness from that project.

    Thanks as always.
     
  2. Zimbres

    Zimbres

    Joined:
    Nov 17, 2014
    Posts:
    180
    Geejayz likes this.
  3. Geejayz

    Geejayz

    Joined:
    Feb 8, 2016
    Posts:
    73
    Hi Zimbres, I'm a little bit late but thank you for this.