Search Unity

Xbox One controller not detected but works with the older input system

Discussion in 'Input System' started by demonixis, Jan 21, 2020.

  1. demonixis

    demonixis

    Joined:
    Aug 20, 2013
    Posts:
    185
    Hello,

    I tried a to call Gamepad.current.leftStick.ReadDefaultValue(), but the gamepad object is null. The list of supported device is empty, that means all devices are used according the documentation (adding gamepad doesn't make it work).
    My question is how to make the gamepad to work as examples? Do I have missed something?

    My setup:
    - Unity 2019.3f5
    - New Input System only OR both
    - .Net Standard OR .Net 4.5
    - Input System Package v1.0.0-preview3
     
  2. Rene-Damm

    Rene-Damm

    Joined:
    Sep 15, 2012
    Posts:
    1,779
    Are other devices (like keyboard and mouse) listed in the debugger? Did you restart the editor after installing the input system package?
     
  3. demonixis

    demonixis

    Joined:
    Aug 20, 2013
    Posts:
    185
    Yes, the keyboard and my Oculus Touch controllers are working well. The gamepad doesn't appear in the debugger. However it's well detected by the old input system. I tried Unity 2020.1a19 and the result is the same.
     
  4. demonixis

    demonixis

    Joined:
    Aug 20, 2013
    Posts:
    185
    @Rene-Damm I tried two new things with Unity 2019.3f5 on Windows 10 (latest update). The first one was to use another Xbox game controller. It doesn't work too, Gamepad.current returns null and Gamepad.all is empty. I tried the Input sample which allows to switch between the old and the new system. The gamepad works, because it's handled by the old system. If i disable the old system's scripts, it doesn't work anymore.
    Is there a place where I can submit the bug? Github? Unity issues?
     
  5. Rene-Damm

    Rene-Damm

    Joined:
    Sep 15, 2012
    Posts:
    1,779
    Ok, that sounds very odd. These are original Xbox controllers? Could you post the exact model you're using?

    Yup, please file a ticket with the Unity bug reporter. Thank you.
     
  6. demonixis

    demonixis

    Joined:
    Aug 20, 2013
    Posts:
    185
    Hi,
    This is what Unity is detecting when I connect my controllers

    upload_2020-1-23_11-20-39.png

    The Xbox application gives me that details:

    upload_2020-1-23_11-21-27.png

    The controller is updated with the latest firmware. The PID/HID are USB\VID_045E&PID_02DD\7EED8017DDC

    As I said, it works with the old system, not the new one. With the new system I can use the keyboard, the mouse and my Oculus Touch controller without any issue.
     
  7. demonixis

    demonixis

    Joined:
    Aug 20, 2013
    Posts:
    185
    @Rene-Damm reported #1213981
    But I've discovered that the controller works when I use it with the remote adapter. It's not work when connected in USB, but works when connected using wireless.


    Code (CSharp):
    1. private void FixedUpdate()
    2. {
    3.         var gamepad = Gamepad.current;
    4.        
    5.         if (gamepad != null)
    6.         {
    7.             Debug.Log(gamepad.name);
    8.             Debug.Log(gamepad.shortDisplayName);
    9.             Debug.Log(gamepad.displayName);
    10.         }
    11. }
    It outputs

    Code (CSharp):
    1. XInputControllerWindows
    2. null
    3. XInputControllerWindows
    This is maybe just an issue in the detection process?
     
    Algost likes this.
  8. RajulG

    RajulG

    Joined:
    Jan 2, 2017
    Posts:
    3
    Hi, having the same problem
    The Xbox controller is detected and works when connected wirelessly, but not when connected via USB.
    Using the New Input System.

    Thanks
     
  9. demonixis

    demonixis

    Joined:
    Aug 20, 2013
    Posts:
    185
    I found that it's depend of the controller. I've a black xbox controller that doesn't work without the wireless key and another one that works in USB Oo. I don't know the difference between them, but it's two official Xbox one gamepads..
     
  10. michaelplzno

    michaelplzno

    Joined:
    Dec 12, 2017
    Posts:
    49
    Hi, I'm having the same issue in this thread with an 8BitDio SN30Pro controller. When I switch to my xbox controller everything works correctly, but the 8BitDio acts like its not connected. Should I submit a bug?
     
  11. tayloreichhorst

    tayloreichhorst

    Joined:
    Nov 14, 2013
    Posts:
    6
    I have tested the same debug log outputs as @demonixis and get the same results. It's detecting the controller, but the shortDisplayName is null. Is this why the new input system does not work with my xbox controller? Seems like something isn't working right.
     
  12. dmytro_at_unity

    dmytro_at_unity

    Unity Technologies

    Joined:
    Feb 12, 2021
    Posts:
    212
    How can we reproduce the issue? Any specific game controllers? The exact model number and the exact setup info would help. Because I see 1213981 was closed as our QA couldn't repro it, but if it happens obviously there is a problem and we need to look at it.
     
  13. tayloreichhorst

    tayloreichhorst

    Joined:
    Nov 14, 2013
    Posts:
    6
    After some more digging. I found I was just using it incorrectly. I think what happened was that xbox controller was tied to user 1, as opposed to just overriding the keyboard/mouse. That is my current understanding. Still learning this new input.

    The xbox shortDisplayName being null lead me to believe maybe it was an issue finding the device. I don't think that was the case, sorry!
     
    dmytro_at_unity likes this.
  14. mwhitmore1

    mwhitmore1

    Joined:
    Mar 26, 2017
    Posts:
    1
    I am having the same issue with an XBox one controller (Model No. 1914). When plugged in using USB, it works with the old input, but not the new input system.
     
  15. dmytro_at_unity

    dmytro_at_unity

    Unity Technologies

    Joined:
    Feb 12, 2021
    Posts:
    212
    @mwhitmore1 on which system? I've tried 1914 over USB on Windows and it seems to work just fine
     
  16. leegod

    leegod

    Joined:
    May 5, 2010
    Posts:
    2,476
    met same problem. I am using unity 2021.1.16f1, newest input system.
    Connected xbox one controller connected to PC windows10 via Xbox wireless adapter.
    In this case, unity editor console window says connected.

    but at game, gamepad = Gamepad.current;
    gamepad.buttonEast sort of things does not work for xbox controller. game does not recognize xbox controller.

    if I connect nintendo switch pro controller, this work well.

    Why? I want to support xbox controller because this is normal for Steam users.

    I did debug like this and result is

    Code (CSharp):
    1. private void Start()
    2.     {
    3.         gamepad = Gamepad.current;
    4.         if(gamepad != null)
    5.         {
    6.             Debug.Log(gamepad.name);
    7.             Debug.Log(gamepad.shortDisplayName);
    8.             Debug.Log(gamepad.displayName);
    9.         }
    10.     }
    [result]
    XInputControllerWindows
    Null
    Xbox Controller
     
    Last edited: Dec 4, 2022