Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Any key/button detection

Discussion in 'Input System' started by Nylash, May 11, 2020.

  1. Nylash

    Nylash

    Joined:
    Dec 4, 2017
    Posts:
    16
    Hello, I am trying to make a simply "Press any key to start" and actually for the keyboard it is okay because there is a "any key" binding, but I don't find it for the gamepad, is there a equivalent way to do it for a gamepad ? Even trough script and not with ActionMap.
     
  2. Ramobo

    Ramobo

    Joined:
    Dec 26, 2018
    Posts:
    212
    There's no built-in action for that. You'll have to create it in code:
    Code (CSharp):
    1. new InputAction(binding: "/*/<button>");
    Remember to enable it.
    <button>
    prevents deltas like the mouse from being captured.
     
  3. Nylash

    Nylash

    Joined:
    Dec 4, 2017
    Posts:
    16
    Thanks ! Just need to don't forget to disable it x)