Search Unity

  1. We are migrating the Unity Forums to Unity Discussions by the end of July. Read our announcement for more information and let us know if you have any questions.
    Dismiss Notice
  2. Dismiss Notice

Question Some mobile devices or emulators detect gamepad even if there is none

Discussion in 'Input System' started by artainex, May 10, 2024.

  1. artainex

    artainex

    Joined:
    May 10, 2024
    Posts:
    2
    Hello. I'm having trouble with the Unity InputSystem while making a mobile game.
    It seems that some smartphones or certain emulators recognize the input device as a gamepad instead of a touchscreen, even when there is no physical gamepad connected.

    I tried checking if there is an actual connected gamepad using Gamepad.all or GetJoystickNames, but it didn't work. How can I solve this issue?


    Seems like there was someone having same issue, but I guess this one is not general solution for various cases.
    ref) https://forum.unity.com/threads/gam...nected-this-occurs-only-on-2-devices.1196839/
     
  2. artainex

    artainex

    Joined:
    May 10, 2024
    Posts:
    2
    When I asked ChatGPT, Gamepad.current.enabled might be false if there is no actual connected gamepad. How about that?