Search Issue Tracker
Duplicate
Votes
2
Found in [Package]
1.0.0
Issue ID
1255346
Regression
No
[Mobile][InputSystem] IsPointerOverGameObject does not work on device when calling it directly as a Public method
Steps to reproduce:
1. Open the user's attached project "InputSystemBugs.zip"
2. Build it to Android
3. Press "Button" in the middle of the screen
4. Notice the console appear on the top of the screen with the green word "INVOKE"
Expected results: "Can't invoke. Pressed on UI" red color message appears in the console
Actual results: "INVOKE" green color message appears in the console
Reproducible with: 2019.4.2f1(1.0.0), 2020.1.0b14(1.0.0), 2020.2.0a15(1.0.0)
Unable to test with: 2018.4 due to project braking
VLNQA00220, Samsung Galaxy Note9 (SM-N960F), Android 8.1.0, CPU: Exynos 9 Series 9810, GPU: Mali-G72
VLNQA00123, Google Pixel 2 XL (Pixel 2 XL), Android R, CPU: Snapdragon 835 MSM8998, GPU: Adreno (TM) 540
VLNQA00024, Xiaomi Mi 5 (MI 5), Android 7.0, CPU: Snapdragon 820 MSM8996, GPU: Adreno (TM) 530
Note: The button only reproduces when calling a public method directly, it will not reproduce if the method is called in the Update function, On some device both messages "INVOKE" and "Can't invoke" will be displayed but still this is unexpected
-
Resolution Note:
IsPointerOverGameObject() will not return correct results when invoked from within action callbacks as input is processed before UI state is updated. The former happens before MonoBehaviour.Update()s are processed and the latter happens within MonoBehaviour.Update()s. Thus, polling IsPointerOverGameObject() from within action callbacks will rely on state from the last frame.
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Some post-processing volume overrides only update after a refresh when using HDRP
- Video Player glitches when Skip On Drop is enabled
- GameObject movement in Scene view becomes stuttery and intermittently freezes when using non-standard pointers across editor tabs or window boundaries
- Addressables.CheckForCatalogUpdates() always returns 0 when "Only update catalogs manually" is enabled
- VFX Graph forces a lengthy recompilation freeze when exiting Play Mode with a cloned Render Pipeline asset
This is a duplicate of issue #1332555