Search Unity

(1135106) Input.GetButtonDown on iOS fires multiple times

Discussion in 'iOS and tvOS' started by AcidArrow, Mar 8, 2019.

  1. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,724
    Case 1135106

    Input.GetButtonDown on iOS with an MFi controller fires every frame the button is held down, instead of firing just once.

    Please fix it, this breaks MFi support as it's almost impossible to press a button and have it fire once, without completely retooling our code to avoid using GetButtonDown.

    (android devices with Android controllers work fine)
     
  2. TomekLKE

    TomekLKE

    Joined:
    Oct 5, 2018
    Posts:
    7
    Hey, I have similar problem with Siri Remote. Did you find a solution ? There is also a bug report on that I found, but no information beyond that.
     
  3. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,724
    We ended up not using GetButtonDown, since we couldn't wait for Unity to be bothered to fix basic functionality.
     
  4. TomekLKE

    TomekLKE

    Joined:
    Oct 5, 2018
    Posts:
    7
    Just for anyone with this problem, I found a workaround using bool locks. The idea is to setup a bool for each button, and initialise them to true. Then in GetButtonDown do a check and return if the flag is false, also set the actual bool to false line after these two lines will ignore any other than the first reading of this input. Then in GetButtonUp for corresponding button set it to true again (this event is called correctly).
     
  5. paulrts

    paulrts

    Joined:
    Jan 4, 2018
    Posts:
    12
    We're experience a similar issue; selected UI buttons are being clicked repeatedly when holding a gamepad button to 'submit' via standalone input module.

    @TomekLKE did you experience this, or have a different workaround for this?
     
  6. TomekLKE

    TomekLKE

    Joined:
    Oct 5, 2018
    Posts:
    7
    We only had this issues with Siri remote, but I saw some bug reports on the same behaviour on controller. Basically GetButtonDown fires every frame the button is down, like it was GetButton instead.
     
  7. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,724
    I just looked up the bug report I did. It’s still open, but there are no updates.

    I’m guessing since they are working on new input stuff they no longer bother fixing regressions for old input stuff, but since they will never finish the new input I guess we will never get something that works.

    It’s the Unity cycle all over again.
     
  8. BaronBoese

    BaronBoese

    Joined:
    Jul 1, 2014
    Posts:
    11
    @TomekLKE Surely we can code around broken functionality but honestly, why don't we just get rid of the GetButtonUp() and GetButtonDown() functions altogether? The GetButton() functions are the only ones working as advertised anyways.
     
  9. ikemen_blueD

    ikemen_blueD

    Joined:
    Jan 19, 2013
    Posts:
    341
    I'm using Unity 2019.2.1f1. I can confirm GetButtonDOwn, GetButtonUp, GetKeyDown, GetKeyUp behave weirdly in Editor, and not work at all in Build. This is quite frustrating...

    EDIT
    I did a complete un-install Unity, and install it again. It works now.
     
    Last edited: Aug 20, 2019
  10. TomekLKE

    TomekLKE

    Joined:
    Oct 5, 2018
    Posts:
    7