Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Worldspace objects going in front of Canvas in Screen Space - Overlay?

Discussion in 'UGUI & TextMesh Pro' started by sauerkraut, Jun 5, 2016.

  1. sauerkraut

    sauerkraut

    Joined:
    Feb 21, 2014
    Posts:
    23
    Hi there - I am scratching my head. I am using Unity 5.3.4F1 and have a canvas with Render Mode: "screen space - overlay" with some buttons in bottom right corner (see image below), but when the plane of certain objects intersects the front of the camera (ie. gets closer than the main camera's near clipping plane, currently set at the minimum of 0.01) then the object goes in front of the canvas, which is supposed to be impossible, but that is what is happening.

    Any ideas? I have perused the online doccos, and nothing suggests that this should be possible, and googling this finds many people trying to correct problems with Canvases in camera or world space, but I can't seem to find anyone with the exact situation as myself.

    Any thoughts?

    upload_2016-6-5_14-50-47.png
     
  2. crispybeans

    crispybeans

    Joined:
    Apr 13, 2015
    Posts:
    210
    Just an idea, Try setting the render group to UI maybe you're rendering in the render group for the rest of the geometry ?
     
  3. Percy-Pea

    Percy-Pea

    Joined:
    Aug 31, 2014
    Posts:
    75
    I've just discovered this in a project i'm on in 5.3.5. A solution was to remove any materials assigned to the images in my Canvas. There are some shaders you can also use (namely the UI ones) to make materials if you do need one.

    Sadly I was using a mobile shader for performance reasons, which doesn't like it :(

    Another solution could be to use a second camera for rendering the UI only.
     
  4. ZackZ

    ZackZ

    Joined:
    Jan 13, 2015
    Posts:
    7
    Try sorting Layer
     
  5. ZackZ

    ZackZ

    Joined:
    Jan 13, 2015
    Posts:
    7
     

    Attached Files: