Space Shooter Tutorial Instantiate Issue

Hi Everyone,
I’m totally new to coding and Unity. I’m going through the Space Shooter tutorial and am having some issues with changes from version 4 and 5 of Unity. For example, the below code is supposed to work in unity 4 but when I use this in unity 5 it says my explosion variable has not been assigned.
I believe there has been changes in how you write code for Instantiate judging by the API reference pages on it but I don’t fully understand it yet.

Any help would be greatly appreciated.

Thanks!

using UnityEngine;
using System.Collections;

public class DestroyByContact : MonoBehaviour
{
    public GameObject explosion;
    public GameObject playerExplosion;

    void OnTriggerEnter(Collider other)
    {
        if (other.tag == "Boundary")
        {
            return;
        }
        Instantiate(explosion, transform.position, transform.rotation);
        if (other.tag == "Player")
        {
            Instantiate(playerExplosion, other.transform.position, other.transform.rotation);
          
        }
        Destroy(other.gameObject);
        Destroy(gameObject);
    }
}

have you dragged something into the “explosion” and “playerExplosion” slots in the inspector?

Thanks for the quick reply! I did have those filled with the prefabs we were given. Not sure why, but after taking a short break it started working without making any changes… Maybe it wasn’t being updated for some reason.