Search Unity

iOS bug in EventSystem.IsPointerOverGameObject?

Discussion in 'iOS and tvOS' started by Eli1234, Mar 11, 2019.

  1. Eli1234

    Eli1234

    Joined:
    Jul 13, 2017
    Posts:
    24
    Hi,

    I’ve encountered what looks like a bug in EventSystem.IsPointerOverGameObject on iOS. I’ve upgraded my unity editor several times over the last few weeks, and code that used to work is no longer behaving as I expect. I’ve reproduced the issue in unity versions 2018.3.7f1, 2018.3.8f1, and 2019.1.0b4, but I didn’t see the issue in 2018.3.0b5 or older.

    The problem is that there appears to be a delay of several frames in IsPointerOverGameObject. When I touch a UI button, for 2 frames IsPointerOverGameObject reports false, then it starts reporting true. To verify that I’m not moving my finger to change the result, I’m Debug.Log’ing the Input.mousePosition every frame, and it reports the same coordinates.

    I’ve also tried using the GraphicRaycaster attached to my canvas to manually raycast at the Input.mousePosition, to look for UI elements. The results of this raycast match IsPointerOverGameObject: the raycast returns no hits for 2 frames, then starts finding all my UI elements.

    I’ve reproduced this behavior on an iPhone XS, but I don’t see it on android or in the editor.

    Is anyone else seeing this behavior, or are there other workarounds I should try? For now my workaround is to queue up my input, and not process mouse/touch events until 2 frames AFTER they actually occur, which obviously has a negative impact on the user experience.
     
  2. odysoftware

    odysoftware

    Joined:
    Jul 21, 2015
    Posts:
    84
    There is definately an issue because with latest verson I am also seeing report of "false" on iOS touch with this function :( ! Guess we need to open an issue tracker report - or did you do already?

    BTW also using a XS Max in order to reproduce it - but working fine on Android/Editor.
     
  3. unnanego

    unnanego

    Joined:
    May 8, 2018
    Posts:
    199
    same here with 2019.3.0b10
     
  4. unnanego

    unnanego

    Joined:
    May 8, 2018
    Posts:
    199
    The problem still exists even with 2019.3.0f1!
     
  5. unnanego

    unnanego

    Joined:
    May 8, 2018
    Posts:
    199
    And with 2019.2.17!
    OMG, are you there???
     
  6. unnanego

    unnanego

    Joined:
    May 8, 2018
    Posts:
    199
    And with 2019.3.0f6!
    HEY! ANYONE???
     
  7. unnanego

    unnanego

    Joined:
    May 8, 2018
    Posts:
    199