Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Bug Subcanvas/Nested Canvas sorting order

Discussion in 'UGUI & TextMesh Pro' started by SF_FrankvHoof, Sep 12, 2022.

  1. SF_FrankvHoof

    SF_FrankvHoof

    Joined:
    Apr 1, 2022
    Posts:
    780
    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:
    upload_2022-9-12_15-5-55.png
    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:
    upload_2022-9-12_15-8-4.png

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

    Danilovisk

    Joined:
    Jun 18, 2016
    Posts:
    4
    Which version are you using?
     
  3. SF_FrankvHoof

    SF_FrankvHoof

    Joined:
    Apr 1, 2022
    Posts:
    780
    Unity 2021.3.6f1
    Should've mentioned that before, my bad.
     
  4. karliss_coldwild

    karliss_coldwild

    Joined:
    Oct 1, 2020
    Posts:
    612
  5. SF_FrankvHoof

    SF_FrankvHoof

    Joined:
    Apr 1, 2022
    Posts:
    780
    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.
     
    nick-morhun and ph3rin like this.