Search Unity

Select UI button with XBOX360 Controller.

Discussion in 'Scripting' started by kdubnz, Oct 27, 2015.

  1. kdubnz

    kdubnz

    Joined:
    Apr 19, 2014
    Posts:
    177
    Can anyone point me to any instructions or hints on setting up XBOX360 Controller to select a UI Button.
    I'm currently ignorant about the controller inputs.

    Regards,
    Kerry
     
  2. tonemcbride

    tonemcbride

    Joined:
    Sep 7, 2010
    Posts:
    1,089
    I'd recommend the 'InControl' plugin - it deals with lots of different controller types and is very easy to integrate.

    There's an older free version here ( https://github.com/pbhogan/InControl ) but the store one is better and more up to date so worth buying if you can afford it.
     
  3. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Plugins like InControl and Rewired are nice, especially if you're making a multiplayer game, but Unity has pretty good built-in support for this, too.

    UI Buttons react to Submit button presses. You can define these buttons in Unity's Input Manager (Edit > Project > Input). For example, you can define another Submit entry for joystick button 0 (the 'A' button on an Xbox controller).

    Unity UI has built-in gamepad navigation (using the Input Manager's Horizontal and Vertical entries), but your UI has to start with an element selected. Assign the first UI Button to your EventSystem's First Selected field.

    You can let Unity UI set up the path of navigation between buttons automatically or change Navigation to Explicit and specify where up/down/left/right go to.
     
    Jroel likes this.
  4. kdubnz

    kdubnz

    Joined:
    Apr 19, 2014
    Posts:
    177
    Thanks Guys,
    Looks like the
    Interaction Components in the UI manual deserve a good study.

    Thanks
    Regards, Kerry