Search Issue Tracker
By Design
Votes
0
Found in
2021.3.39f1
2022.3.31f1
6000.0.4f1
Issue ID
UUM-72970
Regression
No
EventSystem.current.RaycastAll returns incorrect results when moving a Canvas with "Screen Space-Camera" Render Mode
How to reproduce:
1. Open the “IN-77241_repro“ project
2. Open the ”SampleScene”
3. Enter Play Mode
4. Place the mouse on the right edge of the “TestImage“ GameObject
5. Press the Left Arrow key and observe the “TestImage“
Expected result: The GameObject stays green
Actual result: The GameObject flickers or becomes red
Reproducible with: 2021.3.39f1, 2022.3.31f1, 6000.0.4f1
Reproducible on: Windows 10
Not reproducible on: No other environment tested
Note: In step 4 the mouse should be positioned as far as possible from the center of the GameObject, however, enough to turn it green
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
- Unity CIL Linker fails on Player build when persistent listeners have "<" and ">" in their XML attribute names
- ”Lighting data asset ‘LightingData’ is incompatible with the current Unity version…” warnings are thrown when saving Indoors (URP) and Outdoors (URP) Scenes as Scene Templates
- [iOS] The screen blinks when transitioning from custom to Unity splash screen
- [macOS] ”Ignoring depth surface load action as it is memoryless” warnings are thrown when taking Game View Snapshot
- UI Builder Inspector scrolls back up when changes on an expanded but not fully displayed Inspector tab are saved
Resolution Note:
This is as designed because the RectTransform of the image is not computed at the time you make the call for the raycast. A simple fix would be to put the raycast logic in a coroutine that waits until the end of the frame.
You can read more about RectTransform here: https://docs.unity3d.com/Packages/com.unity.ugui@2.0/manual/class-RectTransform.html