Search Issue Tracker
By Design
Votes
0
Found in
2019.1.0a5
2019.4
2020.1
2020.2
2020.2.0f1
2021.1
Issue ID
1301329
Regression
Yes
UI button which is in the higher Hierarchy order is not getting raycast when Prefabs with Canvas are instantiated at runtime
How to reproduce:
1. Open the user's attached "GraphicRaycasterIssue.zip" project
2. Open the "SampleScene" Scene
3. Enter Play Mode
4. Press the "Lower" and "Upper" button on the right side of the Game view
5. Press the "Lower" and "Upper" button on the left side of the Game view
Expected result: "Lower" and "Upper" buttons on both sides of the Game view are interactable
Actual result: "Upper" button on the left side (Instantiated Canvas during runtime) of the Game view is not interactable even though it's Canvas is rendered on top of the "Lower" button's Canvas
Reproducible with: 2019.1.0a5, 2019.4.17f1, 2020.1.17f1, 2020.2.1f1, 2021.1.0b1
Not reproducible with: 2018.4.30f1, 2019.1.0a4
Note:
- In this situation, two Prefabs are getting spawned with Canvas and Button GameObjects and if the first one to be instantiated to a GameObject, which is in a lower Hierarchy order (See attached "1301329_repro.mp4")
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 (2021.2.X):
Everyroot canvas needs a GraphicRaycaster assigned. This is because we use it to know when to compare the depth based on the common rootRaycaster. Otherwise we dont know that they are part of the same hierarchy. Adding a GraphicRaycaster it works as expected. Its a fluke that it works for the InEditor version.