Search Issue Tracker
Fixed in 1.1.0-pre.6
Votes
4
Found in [Package]
1.1.0-preview.2
Issue ID
1297536
Regression
No
EventSystem.current.IsPointerOverGameObject returns false when clicking on the GameObject after losing focus from the Game view
Reproduction steps:
1. Open attached "case_1297636.zip" project and Scenes/SampleScene scene
2. Enter the Play mode
3. In the Game view, click on Click Me button
4. Click in the Hierarchy window (or anywhere else outside of the Game view)
5. In the Game view, click on Click Me button
6. Observe the Console window
Expected result: "Inside" is logged in both lines
Actual result: "Outside" and "Inside" are logged
Reproducible with: 1.0.0 - 1.1.0-preview.2(2019.4.29f1, 2020.1.17f1, 2020.2.0f1, 2021.1.0a10)
Could not test with: 2018.4.29f1(could not downgrade)
Comments (2)
-
sarahnorthway
Apr 21, 2021 17:46
Alternate workaround: Input.mousePosition is correct during the first frame after gaining focus, so you can check its position within specific bounding boxes using RectTransformUtility.RectangleContainsScreenPoint.
-
sarahnorthway
Apr 20, 2021 23:18
It seems raytracing, button clicks and other mouse-pointer-related behaviors also don't work on the first frame after Unity gains focus. Forcing EventSystem.current.currentInputModule.Process() doesn't help.
The only workaround I could manage was to check IsPointerOverGameObject() again a frame or two later if it initially returns false.
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
- var VisionOSEDRHeadromm has a comma instead of a dot when building with Metal Rendering App Mode and local OS localization is set to German
- IAP Catalog remove product “x” and add product “+” buttons are not consistent with other remove and add buttons in the Editor
- Performance issues in Play Mode when quickly hovering the mouse cursor over Hierarchy GameObjects
- Frame Debugger displays incorrect output when FidelityFX Super Resolution or Spatial-Temporal Upscaler is used with Temporal Anti-aliasing or Subpixel Morphological Anti-aliasing
- The layout system is failing to correctly calculate or apply the height of the Japanese fallback font when the primary English font's metrics are used
Resolution Note (fix version 1.1.0-pre.6):
Fixed in: Input System 1.1.0-pre.6
Calling IsPointerOverGameObject() from within action callbacks will not work correctly. Starting with Input System 1.1.0-pre.6 there is a warning when doing so.