Search Unity

Keyboard/controller navigation for buttons - how do you enable, or choose default button?

Discussion in 'UGUI & TextMesh Pro' started by Dreamwriter, Aug 21, 2014.

  1. Dreamwriter

    Dreamwriter

    Joined:
    Jul 22, 2011
    Posts:
    472
    I thought the alternate navigation controls would just work, but they aren't working at all for me. I created three buttons placed vertically, and if I click Navigation Visualize it shows the connections I would expect linking them. If I hover the mouse over them they highlight and when I click them they react, but nothing happens when I press arrow keys, gamepad stick, or gamepad d-pad. Is there something I need to setup, to like tell it the controls or something?

    Also, we need to select a default button to be highlighted, how do you do that?
     
  2. Dreamwriter

    Dreamwriter

    Joined:
    Jul 22, 2011
    Posts:
    472
    I figured it out - when I first setup my UI, it automatically created an EventSystem object in the scene. I left that in the scene but it's not really intended to be a global thing but menu-specific. With that you can set which item is selected by default, and the names of the Inputs that control it. So I set those up and added it to that menu's prefab, and now everything works great.

    I recommend adding some mention to the EventSystem to the Button documentation, or at least to the Navigation documentation.