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
- Out-of-bounds memory access with multiple CanvasRenderers under a Canvas when using Mesh API
- Inspector tries to access file after it was deleted when the file was locked in Inspector window
- Changing Transform values in Search window Inspector loses focus while dragging and stopping mouse without releasing dragging action
- Saving changes on the dirty VFX Graph during the Play mode throws "The referenced script (Unknown) on this Behaviour is missing!" warnings
- VFX Graph Debug Info overlaps the "Initialize" block debug info by default
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.