Subcanvas/Nested Canvas sorting order

I’m trying to optimize my UGUI-Layout somewhat by adding additional canvases to minimize layout-recalculations.

However, when adding a nested canvas, its contents seem to disappear behind its parent/siblings.

Example of my Layout:


8433434--1116944--upload_2022-9-12_15-6-23.png

When adding a Canvas to the “TopRow”-object, the row disappears behind the “Background”-Object.
This happens both when the Background is a sibling or when it’s the parent (Panel).

Expanding the X-Scale of the TopRow shows that the UI is being rendered, but is displayed behind the Background:

Setting Sorting-Orders and Z-Position does not seem to make any difference.

Which version are you using?

Unity 2021.3.6f1
Should’ve mentioned that before, my bad.

There where a bunch of issues related to nested canvas in the 2021.3.6-2021.3.8 . Supposedly it was mostly fixed in 2021.3.9.

See Canvas hierarchy/drawing order broken after upgrade to Unity 2021.3 and Nested canvas elements may get corrupted on Unity 2021.3 for previous discussions.

Had the same issue in 2021.3.9, but I found out that closing my Prefab seems to refresh the Canvas(es) and fix the sorting order. Apparently it’s only a bug INSIDE of the Prefab-preview. Same on 2021.3.6.

2 Likes