I have a particle system BloodSpill that is Instantiated when the player dies by:
Instantiate(bloodSpillEffect, transform.position, transform.rotation);
However, it will appear behind all other sprites (background, ground etc.) NO MATTER what I do. I have the particle system as a prefab and it's sorting layer is set as the same as the player's both programatically and through the options. It's position on the Z axis is also closer to the camera than other objects.
Actually, if I drag one from the prefabs folder and put it in the scene it will appear in front of other sprites, but when I instantiate it through the line of code above it will not show up.
I don't know and am unable to find information on what the difference is between dragging and dropping it from the folder and using Instantiate().