Lunar Lander Missing Reference Exception.

I’m following the Unity cookie lunar lander tutorial for a tare assignment and when playing the game the ship will explode unless you land on one of the landing pads, then the ship doesn’t do anything. It keeps going like it didn’t crash at all. This is the function that’s causing the Missing Reference Exception tell me if you need to see the whole script.

functionExplode() //This drops in a random explosion and destroys the ship
{
varrandomNumber : int = Random.Range(0,shipExplosions.length);
Instantiate(shipExplosions[randomNumber], transform.position, transform.rotation);
Destroy (gameObject);
GUI.Lose();
}

Does the error gives you a line number (related to your script) that shows what is missing?

Yep, “Instantiate(shipExplosions[randomNumber], transform.position, transform.rotation);” This is where the problems at.

You probably didn’t set shipExplosions in the inspector.

I did that and the same thing is happening.