Hi all, this is driving me mad, can anyone help?
What i’m trying to do is have my boss die and make an explosion, where am I going wrong?
currently, once the boss’s health reaches 0, he just carries on, no death, no explosion.
this is my script :
var death : Transform;
var delay : int = 0;
var bossdead : boolean = false;
function Start(){
bossdead = false;
}
function Update(){
if(boss_healthbar.LIVES <= 0){
bossdead = true;
}
}
if(bossdead) {
Instantiate(death, transform.position, transform.rotation);
var boss = GameObject.FindWithTag("boss");
Destroy(boss);
yield WaitForSeconds(delay);
Application.LoadLevel(69);
}