I have a script in which a bomb destroys anything that enters it as long as its in the blast zone and a variable is true.
#pragma strict
var explosion : boolean = false;
Invoke("bombdest", 3);
function bombdest(){
Destroy (gameObject);
Debug.Log ("bomb destroyed");
}
Invoke("explodetrue", 2.7);
function explodetrue(){
explosion = true;
Debug.Log ("bomb exploded");
}
function OnTriggerEnter (other : Collider) {
if (explosion == true)
Destroy(other.gameObject);
Debug.Log ("game object destroyed");
}
The debug.log part goes off when I`m in the blast zone even if explosion is false BUT nothing gets destroyed
Thanks
Thanks I have it figured out now
– mootime