FloorMine not working, please help


My landmine script is as follows,

var Minesound : AudioClip;
var explosion : GameObject;

  function OnTriggerEnter(other : Collider)


	//var contact : ContactPoint = other.contacts[0];
	//var rotation = Quaternion.FromToRotation( Vector3.up, contact.normal ); // Ensure Explosion follow science!
 	var instantiatedExplosion : GameObject = Instantiate(explosion);

	if(other.tag == "Player")
		other.transform.position += Vector3(50 ,30, 0);
		other.gameObject.SendMessage("ApplyDamage", 1, SendMessageOptions.DontRequireReceiver);

Currently the script will trigger once and do damage but

  • There is no explosion
  • After it goes once it cumes up with a MissingReference error saying the GameObject has been destroyed?

Can anyone please help? I want it to continue to go off anytime the player stands on the floor

Given what you’ve shown here, you probably don’t have a valid explosion prefab.

Check herethis is for instaniate you are only asigning one of the items needed it looks like from what i understand you need your prefab, a position and a rotation.

The only instaniate i have is for the explosion though…

it does even do the transform or the damage at the moment