Search Unity

Resolved Control schemes not switching to my gamepad

Discussion in 'Input System' started by PaperMouseGames, Oct 7, 2021.

  1. PaperMouseGames

    PaperMouseGames

    Joined:
    Jul 31, 2018
    Posts:
    434
    Hi there! I'm new to Unity's new input system and I'm trying to make a control scheme for keyboard and mouse and a different one for gamepad, in this case a PS4 controller, and I can't get it to work.

    I plugged the PS4 controller with the wire to my PC, and in Unity I can see it via the Input Debug.

    When I click on it there under Devices I get the following screen:

    upload_2021-10-7_11-49-30.png

    I find it weird because the events are constantly going off even when I'm not pressings anything. I thought it was only supposed to register input on the controller, so maybe something si wrong here?

    In the Input actions I set up bindings for all of my actions under a "Gamepad" control scheme. Each action is checked off to Use in the control scheme of Gamepad. I also have a separate binding for each Keyboard and Mouse action for that separate control scheme.

    When setting up the bindings I used the "Listen" feature and it did register my PS4 input properly (e.g. if I pressed Listen and then pressed the cross button it registered as cross and south button being pressed).

    But once I get in game I cannot seem to get the control scheme to switch to PS4.

    My Player Input script's default scheme is set to <Any> and Auto-Switch is turned on.

    I tried setting the default scheme to Gamepad but when I check the current control scheme via on-screen text I made it says it's always in keyboard and mouse, and sure enough the keyboard and mouse always work and the gamepad never does.

    Not sure if I'm doing something wrong but I just can't get the controller to work in play mode. All the tutorials I've seen about this don't seem to have any issues switchign control schemes.
     
  2. Rene-Damm

    Rene-Damm

    Joined:
    Sep 15, 2012
    Posts:
    1,779
    This is normal for the PS4 controller. It has a built-in gyro and thus has noisy controls that will continuously produce input.

    Which device is listed in the Gamepad control scheme?

    Is there more than one PlayerInput in the game? (in that case you will see more than one user popping up under the "Users" section in the input debugger)
     
  3. PaperMouseGames

    PaperMouseGames

    Joined:
    Jul 31, 2018
    Posts:
    434
    This was it! I had selected the iOS PS4 from the more specifics section because I hadn't seen the generic PS4 option above it.

    Switching to that has resolved the issue, thank you!
     
  4. Rene-Damm

    Rene-Damm

    Joined:
    Sep 15, 2012
    Posts:
    1,779
    Great!