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. Dismiss Notice

How do I…? …wait for any button to be pressed on any device?

Discussion in 'Input System' started by steinbitglis, Apr 28, 2021.

  1. steinbitglis

    steinbitglis

    Joined:
    Sep 22, 2011
    Posts:
    251
    Hey! Is this supposed to be working?
    wait_for_any_button.png

    I can only get
     
  2. becneljj

    becneljj

    Joined:
    May 14, 2021
    Posts:
    1
    Had the same issue. Try this instead:

    Code (CSharp):
    1. InputAction myAction = new InputAction(binding: "/*/<button>");
    2. myAction.performed += context => Debug.Log($"Button {context.control.device.name} device {context.control.name} pressed!");
    3. myAction.Enable();