Halo & Particle systems showing behind sprites?

Hey guys.

When applying Halo and Particle System to my 2D game, it appears behind all my sprites so that it is invisible, how do you fix this?

As shown below:

I’ve tried this, but without succes so far…

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

[RequireComponent(typeof(SpriteRenderer))]
[RequireComponent(typeof(Halosystem))]

public class Halosystem : MonoBehaviour {

    // Use this for initialization
    void Start ()
    {
    }
 
    // Update is called once per frame
    void Update () {
        SpriteRenderer spriteRenderer = GetComponent<SpriteRenderer>();
        GetComponent<Halosystem>().GetComponent<Renderer>().sortingLayerID = spriteRenderer.sortingLayerID;
        GetComponent<Halosystem>().GetComponent<Renderer>().sortingOrder = spriteRenderer.sortingOrder;
    }
}

If it were me I’d use a second camera with a larger depth than the one showing the sprites and put the halo and particle system on a different object (a child object of the sprite if you need them to move together) and put the object in a different layer than the sprites and set each of the cameras culling masks to only show what that camera needs to see, i.e. particle camera shows halo and particles, sprite camera shows sprites and background or just sprites or whatever.

1 Like

Did you found a solution? i have the same problem ):