Search Unity

  1. We are migrating the Unity Forums to Unity Discussions by the end of July. Read our announcement for more information and let us know if you have any questions.
    Dismiss Notice
  2. Dismiss Notice

Question World Space Canvas is hiding 3D Gameobject but not its outline

Discussion in 'UGUI & TextMesh Pro' started by OctoSharko, Jan 4, 2024.

  1. OctoSharko


    Dec 9, 2016

    I am using a free asset store component (Quick Outline), in order to outline some 3d Objects in the game I am working on.

    I now am trying to display a 2D image next to the object, using a world space canvas.

    My problem is that the image is hiding the object properly but not the outline.

    I'm struggling to find out why that might be.

    Any thoughts ?

    Screenshot 2024-01-04 at 14.20.36.png

  2. Kurt-Dekker


    Mar 16, 2013
    Three (3) primary ways that Unity draws / stacks / sorts / layers / overlays stuff:

    In short, as far as the Standard Rendering Pipeline,

    1. The default 3D Renderers draw stuff according to Z depth - distance from camera.

    2. SpriteRenderers draw according to their Sorting Layer and Sorting Depth properties

    3. UI Canvas Renderers draw in linear transform sequence, like a stack of papers

    If you find that you need to mix and match items using these different ways of rendering, and have them appear in ways they are not initially designed for, you need to:

    - identify what you are using
    - search online for the combination of things you are doing and how to to achieve what you want.

    There may be more than one solution to try.

    For instance, you may even use multiple co-located cameras to more-explicitly control apparent draw ordering.

    Additional reading in the official docs:

    And SortingGroups can also be extremely helpful in certain circumstances:

    Other rendering pipelines may have other ways of layering (HDRP and URP). Go see the latest docs for details.

    There's lots of third party open source packages available as well, such as this:
  3. OctoSharko


    Dec 9, 2016
    Thanks for the pointers !