The one i don’t want it to haha.
The problem is my enemy is supposed to take 2 shots to die. But when the game starts he takes 2 hits to kill, but after re-spawning he takes only 1 hit to kill.
i used this:
var explosion: Transform;
var enemyHealth :int;
function OnTriggerEnter( otherObject: Collider ){
if(otherObject.gameObject.tag == "bullet"){
enemyHealth -=1;
audio.Play();
}
if(enemyHealth<1){
playerScript.playerScore += 200;
var tempExplosion: Transform;
tempExplosion = Instantiate(explosion, transform.position, transform.rotation);
gameObject.transform.position.y = 7;
gameObject.transform.position.x = Random.Range(-6,6);
}
}
What can i do to fix this, or to make more clear.
Thanks!