Displaying a 3D Object in Canvas - Overlay

Maybe in my Items Menu, I’d like to have a rotating display of a 3D Item, and I’d like to have it in the Canvas object itself so it isn’t covered by anything (i.e. water, trees, etc.)

When I do this, though, the object just doesn’t show up. No matter where in the Sorting Layer I have it, or where I drag it in the Canvas’ hierarchy.

The Canvas object is a component used to render UI elements, not 3D game objects.
Even if you place your 3D item under it, the canvas will not render it…

You can achieve what you want in a few different ways:

  • Render your UI in world space / camera space using 1 camera, and your 3D item using another camera. Control their rendering order using the camera’s depth parameter.
  • Render your UI in world space / camera space using a camera, and control the sorting order of both your canvas and your 3D Items. For the canvas - this is exposed via the inspector (on the Canvas component), but for 3D objects i think you have to do this from script (renderer.sortingOrder)

There are possibly other ways, but these are the 2 i’m familiar with.

1 Like