I'm working in 2D.
I have set up 2 cameras. One for UI and another one for gameplay.
I need the UI to be rendered after before game objects (over gameplay). I wanted to achieve this without using world space canvas, because It requires being scaled for every other device along with a camera.
UI can be drawn over gameplay using greater depth than gameplay camera. And because it's depth only there is no solid color, so it all works well.
But you cannot set gameplay camera to depth only because it doesn't render things right, it doesn't clear the render texture I guess.
So this is what happens if gameplay camera is set to depth only.
This is what happens when gameplay camera is set to Solid Color and UI Camera has bigger depth. You can see that the ring is covered by UI arrow.
If the UI Camera depth would be lower than gameplay camera (Solid Color). It would all be covered by gameplay camera without even displaying UI.
These are mine settings.
Is there a way to achieve this in Unity without using World Space Canvas Mode?