particles behind background

I have some code in a primarily 2d game for moving a UFO and creating an explosion when the UFO gets hit by a missile:

using UnityEngine;
using System.Collections;

public class UFOmover : MonoBehaviour {
    public GameObject particleExplosion;

    // Use this for initialization
    void Start () {
  
    }
  
    // Update is called once per frame
    void Update () {
        this.transform.Translate (0.01f, 0, 0);
    }


    void OnTriggerEnter2D(Collider2D other)
    {
        Instantiate (particleExplosion, this.transform.position, Quaternion.identity);
        Debug.Log ("trigger triggered");
        Destroy (this.gameObject);


    }

}

However, the problem is the explosion seems to always show up behind the background. Any ideas how to fix this?

I tried changing the Z value of the explosion and putting it on the top layer, but the explosion still seemed to be behind the background.

I’m here with the same problem

Okay guys.
Can you both show, a short video, or some screenshots of this problem?

** @boolfone **
I noticed, that you have the word Quaternion, in line 20 of your code**.**
From what I know, Quaternion, is used for 3d.

** @Disc0nnected ** do you have the word Quaternion, in your code too?

PS: Boredmormon and other Unity coder guys, concerning Quaternion
I know that in the Unity manual, it says that Quaternion, is for 3d.
Or is it that Quaternion, can now be used, for 2d now? :slight_smile: