Search Issue Tracker
Fixed in 2021.2.X
Votes
0
Found in
2018.4
2019.3.0f6
2019.4
2020.2
2021.1
2021.2
Issue ID
1313831
Regression
No
RectTransformUtility functions that output a Vector, output only (0,0,0)/(0,0) when Canvas sits on the NearClipPlane of a Camera
How to reproduce:
1. Open the attached project "case_1313831 RectTransformUtility_Not_Working.zip"
2. Open the Scene "SampleScene"
3. Select the "Canvas" GameObject from the Hierarchy window
4. In the Inspector window, make sure that Render Mode is set to "Screen Space - Camera" and Plane Distance is set to 0.3
5. Select the Console window and enter Play mode
6. Move the mouse around and observe the values output to the Console window
Expected result: Mouse Position in the world-space and on the Canvas relative to the Position on-screen is returned
Actual result: (0, 0, 0) and (0, 0) are returned constantly
Reproducible with: 2018.4.32f1, 2019.4.21f1, 2020.2.7f1, 2021.1.0b9, 2021.2.0a7
Notes:
- Increasing the Plane Distance just by a little bit, for example to 0.3001 instead of 0.3, resolves the issue
- RectTransformUtility.ScreenPointToWorldPointInRectangle() and RectTransformUtility.ScreenPointToLocalPointInRectangle() are the functions with the issue, other functions work as expected
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
- Articulation Body with 'Revolute' Joint Type has erratic behavior when Upper Limit is set to above 360
- WebGL Player fails to render Scene when Terrain with Detail Mesh is added and WebGPU Graphics API is used
- Inconsistent errors are logged when different types are passed into the Query "Q<>" method in UIToolkit and the ancestor VisualElement is null
- Crash on GetMaterialPropertyByIndex when opening a specific Scene
- Discrepancies in the styling are present when using a TSS file instead of a USS file in custom EditorWindow
Resolution Note (fix version 2021.2):
When the point is on the plane the current rayPosition will be used.
Fixed in 2021.2.0a11