Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice
  3. Dismiss Notice

Triggers don't work on android

Discussion in 'Input System' started by piggybank1974, Sep 10, 2020.

  1. piggybank1974


    Dec 15, 2015
    In my quest to get a gamepad to work for my main game on android, it's turning out to be a pain.

    although everything is working now apart from the triggers on android.

    Although slightly off-topic I did a post last night about the problem with "devices[a] is UnityEngine.InputSystem.Joystick" android always thinking it has a joystick attached, this apparently I found out tonight that the above code or "UnityEngine.InputSystem.Joystick" happens to be needed if you have a controller present well the 8BitDo anyways, otherwise, it does not function "pick up the controller" for windows.

    Code (CSharp):
    1. UnityEngine.InputSystem.Utilities.ReadOnlyArray<UnityEngine.InputSystem.InputDevice> devices = UnityEngine.InputSystem.InputSystem.devices;
    2.     if (devices.Count > 0)
    3.      for (Int32 a = 0; a < devices.Count; ++a)
    4.       if (devices[a] is UnityEngine.InputSystem.Joystick || devices[a] is UnityEngine.InputSystem.Gamepad)
    5.         {
    6.          mManagers.Project.Settings.DeviceType = DeviceTypes.GAMEPAD;
    7.          Debug.Log("A Gamepad Has Been found");
    8.          break;
    9.         }
    So back to the case in point, as you can see from the screenshot the 8BitDo's triggers are Button9 for left Trigger and Button 10 for the right trigger, I used the listening button to find these as it does not use the traditional left/right trigger syntex, when running on windows the triggers work fine, but on android I get nothing, I did also look at the windows input debugger window to verify that the buttons are firing and they are.

    has anybody got any idea's, how to fix this?

    Attached Files:

  2. JamesL98


    Oct 9, 2014
    Yea one year later I've just encountered the same issue. Did you end up resolving this?
    I confirmed with the unity controller input app helpfully available on the play store that this is the case.
  3. piggybank1974


    Dec 15, 2015

    Hi James sorry for the late reply, I just happen on my annual leave "One Month" to be doing some unity, I ended up using the new Input System, and it does work in my game, but I'm not sure if they fixed the bug with the UnityEngine.InputSystem.Joystick as without this it does not register properly in the editor.

    I remember the unity dev asked me to post the bug to them, but he was reply in the post so he could see it.
    Iwhold likes this.
  4. debasishiit15


    Nov 29, 2023
    In 2024, encountered the same issue.
    Did anyone resolve this issue or not? Can't find anything online.