Search Issue Tracker
By Design
Votes
0
Found in
2021.2.6f1
Issue ID
1392852
Regression
No
[UI] Button can only be partially clicked on the main game scene in a windows standalone build
Reproduction steps:
1) Open the localization test project.
2) Build and run a windows standalone build.
3) In the game, navigate to the game scene by clicking on the text buttons.
4) Click on the button on top of the main game scene.
Expected result: The button can be highlighted and clicked normally.
Actual result: The button can be highlighted and clicked on in certain small areas.
Reproducible in: 2019.4.32f1, 2020.3.23f1, 2021.2.6f1
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:
There are 2 canvases in the scene - UI and 1 for the cursor. They both have a sort order of 0. In the player they just happen to get sorted in a different order, its a common problem when sorting identical values, different platforms may do it differently or a change in initialization may happen to cause them to be added in a different order. I did not look into why this time it happens as the root problem is the same, they both have the same sort order.
So when the cursor canvas happens to be first the mouse raycaster selects the actual cursor and not the button behind it.
Do the following:
Disable raycast target on the mouse cursor so it cant select itself.
Change the UI canvas sort order to 1 so that its the same in the player and editor.