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
- The Up, Down and other Buttons in a Style Sheet's Inspector unselect items when they are clicked while they are disabled
- Virtual Player remains active and still launches when removed from Additional Editor Instances from a custom Play Mode Scenario
- UI Toolkit Editor Window Creator becomes not interactable and greyed out when a long name is entered
- [Web][iOS] Web Player keeps restarting on launch when Native C/C++ Multithreading is enabled
- "Add Scene to Scenes in Build" pop-up reappears after Scene has already been added and another Multiplayer Editor Instance is loaded
This is a duplicate of issue #1332555