Search Unity

Bug OnPointerDown not firing consistently

Discussion in 'Input System' started by paulstraw, Mar 26, 2021.

  1. paulstraw

    paulstraw

    Joined:
    Apr 17, 2017
    Posts:
    4
    Hi there! I've submitted a bug report to Unity about this, but thought I'd ask here in case anyone has run into a similar issue. I'm not sure this is actually specific to InputSystem (it seems like a lower level problem to me), but I first noticed it when using InputSystem's OnScreenButton.

    I'm seeing an issue where OnPointerDown isn't firing consistently on iOS (I haven't tried Android, and don't have a good way to test this case on non-touchscreen devices). If I quickly press buttons one after the other, sometimes the second OnPointerDown event will never actually fire.

    I've set up a reduced test case in the linked project zip below. It's using InputSystem's OnScreenButton, which implements IPointerDownHandler. This is just being used by the ButtonUpdater to perform some logging and update button colors. Please see the linked video for more explanation and a demonstration (including a slow motion segment at the end to show the timing better).

    You'll notice that this project is using InputSystem 1.1.0-preview.3. This is because I was hitting an issue in 1.0.1 where when multiple controls were activated around the same time, one would sometimes get stuck on instead of never activating at all. This forum thread has other people discussing that issue, though I'm not sure if it's actually related, or just looks related: https://forum.unity.com/threads/ons...ng-two-at-the-same-time.1022023/#post-6651631

     
    dvdfu, PereiraFranco and kyuskoj like this.
  2. kyuskoj

    kyuskoj

    Joined:
    Aug 28, 2013
    Posts:
    56
    I have this issue too. Unity 2021.1.18 with Input System 1.1.1 (Android. Galaxy S9)
    I also tested with 1.0.2, 1.1.0-preview3. And they have this issue too.

    ps.
    It's a cumbersome way, but I found a solution.
    1. Change 'Project Settings/Player/Active Input Handling' to Both.
    2. Replace InputSystemUIInputModule to Standalone Input Module.
     
    Last edited: Sep 14, 2021
  3. kyuskoj

    kyuskoj

    Joined:
    Aug 28, 2013
    Posts:
    56
    Does anyone have this problem? This issue still occurs in 2021.1.24f1. (Input System 1.1.1)
     
  4. kyuskoj

    kyuskoj

    Joined:
    Aug 28, 2013
    Posts:
    56
    Last edited: Oct 15, 2021
    PereiraFranco likes this.
  5. Pheonix1202

    Pheonix1202

    Joined:
    Aug 4, 2018
    Posts:
    1
    I have same issue. After 2 rapid clicks to object located elsewhere than Vector2.zero, on 3rd click im getting OnPointerDown with pointerEventData.position equals to Vector2.zero at the object in same position.
    InputSystem Version 1.1.1, Unity 2021.1.20f1
     
    kyuskoj likes this.
  6. CodeWithKyrian

    CodeWithKyrian

    Joined:
    Aug 17, 2017
    Posts:
    9
    Last edited: Aug 29, 2022
  7. dvdfu

    dvdfu

    Joined:
    Sep 1, 2015
    Posts:
    11
    I have precisely the same issue - rapid clicks seem to sometimes (10% of the time?) not trigger the latter's OnPointerDown.

    I've only encountered this issue with OnScreenButton for some reason - I don't think regular UI buttons have had this issue.

    Input System 1.3.0
    Unity 2021.3.6f1