Search Unity

Why Canvas render mode is set by default to 'Screen space - overlay' ?

Discussion in 'Getting Started' started by AdrianHil, Feb 19, 2018.

  1. AdrianHil

    AdrianHil

    Joined:
    Feb 1, 2018
    Posts:
    26
    Hi guys!

    I'm working currently on UFO 2d tutorial and one things bothers me - Why Canvas elements has set "Render mode" to "screen space - overlay" by default ? and how it's happen that even this text is outside of the camera in the scene it's in the "Game" view on the right place (look at the picture below) ?

    upload_2018-2-19_23-27-45.png
     
    Last edited: Feb 19, 2018
  2. methos5k

    methos5k

    Joined:
    Aug 3, 2015
    Posts:
    8,712
    Overlay doesn't need the camera? It's just your screen :)

    I don't know why they chose it as the default, but I imagine because it's the simplest. Personally, I use it 99.5+% of the time :)
     
    Ziplock9000 and AdrianHil like this.
  3. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    21,144
    One of the settings has to be the default...

    That's what it's supposed to do when set to "Screen Space - Overlay". It's overlaying the UI onto the screen after everything else is rendered. If you don't want it to function in that manner then you need to set it to a different render mode.

    https://docs.unity3d.com/Manual/UICanvas.html
     
    Ziplock9000 likes this.
  4. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,859
    I agree though that it's weird how different the scale is in the scene editor. In most projects you end up with your entire play area taking up this itty-bitty little corner of the UI area. And when working on the game objects, you have any UI elements that happen to be in the lower-left corner blown up to gargantuan proportions.

    I railed against this a bit when the new UI stuff first came out, and by fiddling with the canvas scale properties enough it is possible to get it to a more realistic scale where you can see your UI and your game at the same time... but then I got over it, and now just switch between the two as needed.
     
    AdrianHil and Ryiah like this.
  5. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,860
    My go to mode is Screen Space - Camera with a plane distance as near. Works well for seeing everything in the editor at once. I would recommend it for small 2D games.

    As soon as you go to 3D or multiple cameras, Screen Space - Overlay makes more sense.

    World Space is also cool to play with. Mostly useful for informational stuff. Make sure you delete the ray casters if you use it a lot.
     
  6. AdrianHil

    AdrianHil

    Joined:
    Feb 1, 2018
    Posts:
    26
    Thanks for all answers! now it's clear for me :)