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