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
- "Shader warning in 'Hidden/Light2D': implicit truncation of vector type" is thrown when building Universal 2D template
- AI Assistant breaks compilation of packages using System.Runtime.CompilerServices.Unsafe via auto-referencing
- Unity Hub checks the "Documentation" module by default on the 6.4 and 6.5 streams despite that it was unchecked with the previous installs
- Shortcut that toggles between Dopesheet and Curves Views in the Animation Window's Timeline is mislabed
- Property List Items Overlap onto the Property List's top edge when scrolling through a long Property List
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.