Search Unity

Unity UI Using Two Canvas

Discussion in 'UGUI & TextMesh Pro' started by Darkhalo45, May 17, 2017.

  1. Darkhalo45

    Darkhalo45

    Joined:
    May 7, 2016
    Posts:
    18
    I am trying to make a smooth fade transition between scenes, but cant get it to work how I want it to. I have two canvases, one is in the scene and the other canvas, which contains the fading background, is DontDestroyOnLoad. I want the canvas with the fading background to be on top of all the other UI, but the canvas in scene is overlapping the other one. How can I change which canvas goes first?
     
  2. christougher

    christougher

    Joined:
    Mar 6, 2015
    Posts:
    558
    Are the canvases both screen space overlay? Also what is the sort order for each canvas? Set the fading canvas to a higher number. If they both have the same number I think their hierarchy in the scene determines which is rendered on top.
     
  3. SimonDarksideJ

    SimonDarksideJ

    Joined:
    Jul 3, 2012
    Posts:
    1,689
    I would recommend having a separate scene for the fading UI and include it in your master scene. That way you don't need "DestroyOnLoad" as you are simply adding new scenes behind it.

    But as @christougher states, the higher the position in the hierarchy determines when something gets drawn.