- Home /
Particles behind/in front of other particles
So, I'm learning how to make particles with shuriken and I've been having quite some progress. I tried to make an "Wind Waker-like explosion", and for me it looks pretty good, but this is ruining it all:
Here's my problem: in the 1st picture, the orange smoke was supposed to be BEHIND the brown smoke, and in the 2nd one, part of the brown smoke was supposed to be behind the orange one, but it's either completly in front or completely behind, depending of the camera angle...
The explosion looks like this:
The brown smoke act like an "impact wave" so, as I said, part of it was supposed to be in front of the orange, while the rest should be behind. I'm using the "Particles/Alpha Blended" shader for the smoke material, because it's one of the few that shows the smoke the way it is in the image (the only other that I found was "Sprite/Default", but the same thing happens).
So, how can I fix this?
did you solve this problem? I have similar issues while I cant find any help with it :(
Answer by Anxo · Jan 06, 2015 at 08:47 PM
Change particle render layer via code.
http://answers.unity3d.com/questions/577288/particle-system-rendering-behind-sprites.html
This is for sorting layers, Sorting Layers only appears in 2D mode, right? This project is 3D.
Sorting layers are actually applied to everything. If a sprite or particle is on the Default sorting layer then it's Z coordinate will be taken into consideration when drawing.
Particle Renderers have a sorting layer and order too but it's not exposed to the inspector, you have to write a script for that. I don't think this issue has anything to do with the sorting order though. It's more likely that the problem has to do with the $$anonymous$$aterial and how you're using it. Your particle systems may also have Static Batching enabled.
@smoggach How do I disable the static batch? And how can I check if the problem is the material?
In the very top right of the inspector there is a little checkbox labelled "Static" If it's ticked then unity will try to static batch this object.
Perhaps try $$anonymous$$obile/Particles/Alpha Blended. You might also try using the same material for both systems or different one.
The issue may also be the camera layers. Are both of these systems on the same camera layer? (the combo box just below the static checkbox). They should be on the same layer.
@smoggach The static checkbox was already disabled, so I tried activating it, but nothing changed. I also tried the mobile shader, but again, nothing changed. And yes, they're on the same layer (they're both on the "Default" layer).