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

Multiple ScreenSpace Overlay canvases

Discussion in 'UGUI & TextMesh Pro' started by Whippets, Aug 28, 2014.

  1. Whippets

    Whippets

    Joined:
    Feb 28, 2013
    Posts:
    1,775
    I have a canvas and eventsystem GameObjects that cross all scenes with DontDestroyOnLoad. On top of this each Scene has it's own canvas.

    The issue I'm having is that the individual scene canvases seem to work perfectly, but the canvas that crosses all scenes doesn't show.

    Looking in the Hierarchy I can see that both canvases are active, but I think I'm missing something about zIndex or localPosition. Is there something I need to change so that both canvases show?
     
  2. dakka

    dakka

    Joined:
    Jun 25, 2010
    Posts:
    113
    I had a similar issue using Screen Space - Overlay and multiple canvases when bringing 'popup' windows into the next scene ie DontDestroyOnLoad. The Z order was different from the first scene. Not sure if this is a bug or not.

    I found that I needed to use Screen Space - Camera and specifically define the sorting layers.
     
  3. Whippets

    Whippets

    Joined:
    Feb 28, 2013
    Posts:
    1,775
    Thanks dakka.
    I tried that, but I'm still getting the Z fighting problems. I created sorting layers too, but same issue. I can see both canvases in the SceneView, but not in GameView. Is there something else I'm missing?
     
  4. dakka

    dakka

    Joined:
    Jun 25, 2010
    Posts:
    113
    I got caught, when you keep a canvas across scenes ie DontDestroyOnLoad the camera is missing unless it is part of the hierarchy. Also the sorting layers work like tags, you need to name it, then apply it to the object.
     
  5. Whippets

    Whippets

    Joined:
    Feb 28, 2013
    Posts:
    1,775
    Having got it working (sort of), it seems a bit buggy/a lot of extra hassle.
    I'm reverting to my original method of a single canvas per scene, with copies of the same window in each. I don't feel it's the right way, but it's certainly the least buggy.
     
  6. phil-Unity

    phil-Unity

    Unity UI Lead Developer

    Joined:
    Nov 23, 2012
    Posts:
    1,226
    Could you submit a but with this? It sounds like there might be a issue registering a canvas to be drawn when its saved across scenes.