Unity Issue Tracker - PhysicsRaycaster.ComputeRayAndDistance() does not detect mouse input on colliders when multi-display setup is used
Fixed
UUM-78726
PhysicsRaycaster.ComputeRayAndDistance() does not detect mouse input on colliders when multi-display setup is used
Unity: uGUI
Fixed
2022.3.X
Won't Fix
2021.3.X
Porting this fix to version 2021.3 would involve incorporating other major changes that come with it. Considering the importance of maintaining the stability of the 2021.3 release, it is too risky to include these updates.
Reproduction steps:
1. Open the attached “PointerInputTest.zip” project
2. Have a setup of at least two displays
3. Build and Run the project (File > Build and Run)
4. In the Player on a secondary display, click on colliders
Expected result: The colliders get clicked on and the clicks are logged in the Player
Actual result: The colliders do not get clicked on or incorrect colliders get clicked on
Reproducible on: Windows 11
Not reproducible on: No other environment tested
Notes:
The mouse input detection on the primary display works correctly
Modifying PhysicsRaycaster.ComputeRayAndDistance() to use GetRelativeMousePositionForRaycast() instead of RelativeMouseAtScaled() fixes the issue and enables correct input detection across multiple displays
Prioritise and Follow this issue
Have a workaround or additional info about this issue?