I am trying to render some quads using a mesh with a spritesheet as texture (the reason I use a mesh is that I’m basically drawing a ton of static stuff on the game map that have no behavior; in other contexts the same spritesheet is used with a SpriteRenderer, animation, etc).
The sprites on the sheet have transparent pixels, and the quads for the sprites overlap (the spritesheet has gear options for equipping the characters, so I would draw a head, the draw a helmet on top, etc).
I have an orthographic camera pointing down the Y axis.
The issue is that when I try to layer the sprites using a mesh, with e.g. a quad for head at Y = 10 and a quad for helmet at Y = 20 (or 200), the orthographic camera seems to ignore Y. I can see in scene view that the helmet quad is “above” the head quad with respect to the camera, and yet the camera renders the head over the helmet; the defining factor seems to be the order in the vertex/triangle/uv arrays of the mesh - whatever quads are added later to the arrays (i.e. are at higher indices), gets rendered on top, regardless of Y…
Why is that?