Sprites and Particles are not ordering properly

I have sprites in my scene that are not being rendered correctly around particles.
Both have an “order in layer” property that I can set, and if those have different values then the higher one is drawn on top, but when they are on the same layer I can’t seem to adjust the draw order.

I’m working in 3D space and I need the render order to be set by the distance from the camera. I can’t just set a higher/lower order in the layer because a sprite may be in front of a particle effect or behind it; they change positions at run time.

How do I get the render order to be set by camera depth?

Three (3) ways that Unity draws / stacks / sorts / layers / overlays stuff:

In short,

  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.

Additional reading in the official docs: