2D sprites and ParticleSystem issue

Hi,

i read a lot of the problems with the particle system and 2d sprite, i try every solution i find but the best approach i found is use a Unlit/Trasnparent Cutout shader who is not recommended for mobiles (because performance), i tried changing the sortinglayername, the z-index, all shaders i found but this is the only thing it worked for me.

i would to know if that shader is the worst for mobile or is something acceptable or if anyone knows how to work with sprite and particles.

Note: i have a sprite background in sortedlayerName “Level” and index 0 and need to draw the particle in front of this background.

Thanks you for your time :slight_smile:

try make c# script with lines:
public int partLayer;
void Start () {
particleSystem.renderer.sortingOrder = partLayer;
}
then add it to particle object and set layer, what you need

WTF xD!! this works… i have this code and doesnt work i dont know why this do it…

public class CoinScript : MonoBehaviour {

    ParticleSystem particle;

    void Awake()
    {
        particle = GetComponentInChildren<ParticleSystem>();
        particle.renderer.sortingLayerName = "Particles";
        particle.renderer.sortingOrder = 1;
    }
    void OnTriggerEnter2D(Collider2D other)
    {
        if(other.tag == "Player")
        {
            renderer.enabled = false;
            particle.Play();
        }
    }
    void OnDisable()
    {
        renderer.enabled = true;
    }
}

thanks anyway :slight_smile: