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
- Mono Windows Builds don't produce full log callstacks when generating logs
- AssetBundles fail to load when running in Built Players for Mobile Devices
- UI elements with text gets bigger and grey when Player window is moved to another screen with different resolution
- System name accepts multiline text but crops it on confirmation, duplicates input, and shrinks the field when empty
- UI element scale and position are wrong in project build when DRS is changed with HDR and Software Dynamic Resolution enabled
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.