how to draw a sprite that is not affected by main camera?

Hi,

I’m working on a 2D game. My main camera is set to orthographic projection, and I use the orthographic size parameter to alloy the player to zoom in and out on the board.
Now I want to draw some sprites that are independent of the zoom, ie the main camera’s orthographic size.
I’d like to avoid using UI’s Canvas for these sprites, if possible.
I tried many things, especially creating a new Camera, but there is something I don"t understand and I can’t avoid my sprites to be affected by the orthographic size changes on the main camera. I read all the documentation I found about the Camera, but I didn’t find anything that can explain this.
Any help is welcome, thank you in advance,
rOd.

Thank you Cherno,

it’s exactly what I tried to do, but the sprites didn’t showed up. Now I found out that the sprites are drawn, but they shows up under the other sprites, so they are masked. I tried to play with the Z position of the sprite, but it does change nothing.

More precisely: my game is in top view. I got a ground made of tile. Each tile is a sprite, on Z position 0, that I put in a layer “ground” and are displayed by the main camera. Now I added a new sprite “selector”, on a layer “MyUI”, and a new Camera displaying only the layer “MyUI”. The problem is that this sprite “selector” is drawn behind the ground tiles, whatever it put on his Z position.

Is there any way to force the rendering order of the different cameras?

Well, i am not sure if it works, but I would put a new camera at the same position like your first camera. The new camera should render only one layer (Culling Mask). That layer should be the same like your object that should not be zoomed. Set the depth of the new camera higher than your first camera and set the clear flags to depth only or don’t clear.