I'm trying to make an enemy for my game, and everything works, except for the bit of code where the enemy is supposed to die.
My player attacks but nothing happens.
I filled in the prefabs, I have the right tags, I tried remaking it and I can't find anything that is wrong.
What am I doing wrong?
#pragma strict
var EnemyItself : GameObject;
var EnemyCorpse : GameObject;
function OnTriggerEnter(other : Collider) {
if (other.gameObject.tag == "Hero Punch") {
EnemyItself.SetActive(false);
EnemyCorpse.SetActive(true);
}
}