Search Unity

How to Navigate UI with dpad?

Discussion in 'Input System' started by ZolnierGames, May 27, 2021.

  1. ZolnierGames

    ZolnierGames

    Joined:
    Feb 19, 2018
    Posts:
    88
    So, I am successfully able to navigate across the UI elements in my scene with the left-stick on my gamepad but is there any way to also use the dpad on the controller to also navigate between UI elements? I am having a tough time getting anything with the controller dpad and UI to work, only the left stick and keyboard navigation seem to work. Any suggestions on what can be done here?
     
  2. ZingZangGames

    ZingZangGames

    Joined:
    Dec 11, 2020
    Posts:
    72
    Add a vector2 composite in your inputactionsasset. Then you should have 4 slots with up/down/left/right. You can have multiple one of each of the composite slots, so just duplicate them and for the first up-slot Keyboard/W, for the second up-slot Dpad/UP, and so on. After that, assign the composite action to the input module in your scene which should be connected with an eventsystem and a playerinput.