Basically, I have a problem where OnBecameInvisible activates when I load the next level, and I can’t have that because it ends up adding 2 points to the score instead of just 1.
Does anyone know how I can fix that?
relevant part of the script:
if (health < 1) {
addEnemyScore();
}
}
void OnBecameInvisible() {
addEnemyScore ();
}
void addEnemyScore() {
dfScore.p2Score = dfScore.p2Score + 1;
dfScore.winner = 2;
Application.LoadLevel(5);
}