instantiating a prefab particle system

HI Everyone,

I am getting an error from a script i have written where a particle system will spawn to simulate an object exploding.

The particles are set to instantiate when the main object is collided with. Here is the code.

void OnCollisionEnter2D(Collision2D other)
     {   
     if (other.gameObject.name  == "Player") {
       brick_boom.Play ();
       Instantiate (brick_pop,transform.position,transform.rotation );
        daBrick.enabled = false;
       Destroy (gameObject,2f);

     }
     }

However when i hit the object i get the error Unassigned reference exception.

I have the public ref set as brick pop and have dragged the brick explosion prefab into that slot in the inspector.

Any ideas what i am doing wrong?

Thanks

Can you tell in which Line the Error Occurs?
Atm i can’t tell what “brick_boom”, “daBrick” is,
maybe there is an error ? Any further Informations ?

My mistake. I had two copies of the script attached to the object. Script one didn’t have the prefab attached, Causing the error

Thanks for your looking though.