For context, I’m making a top-down 2D game and I’m using URP with a 2D Renderer. To sort all of my sprites properly, I’ve set my Transparency Sort Axis to a Custom Axis set to (0, 1, 0), and all of my sprites have their pivots set to the bottom of the image.
I have a visual effect in my game where spikes shoot up from the ground. By default, the spikes aren’t sorted correctly using the Y-axis like all the other sprites, but I’ve found out that I can sort them by using a custom Sort Mode in the output of the particle quad. The image below shows them all sorted correctly, where spikes closer to the bottom are drawn above spikes closer to the top.
However, while this does properly sort the particles among themselves, it doesn’t sort them with other sprites on a per-particle basis. If both are on the same sorting layer and have the same order in the layer, then either all of the spikes will be above the sprite, or all of them will be below the sprite. In the image below, you can see that the character is drawn over every single spike sprite, even though they should be drawn behind some of them, but above some others.
I found this forum post that says that the sort point for a VFX Effect is based on the position of the entire system’s bounding box, and this seems to be true. However, for an effect like the one I have, I need every particle in the effect to be sorted individually, based on its individual Y-position. Is there a way to do this? Thanks!