zHi,
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