So what i’m trying to achieve is that everytime a zombies health reaches 0 the players score is increased by one. I currently have no clue why this sin’t working. Here is my code
Code within the enemy class:
if (health <= 1) {
SurvivalScore SS = (SurvivalScore)target.GetComponent ("killscore");
SS.killscore (+1);
}
Code within the scoring system:
public int zombieskilled
public void killscore(int adj) {
zombieskilled += adj;
}
Any help will be appreciated as currently the score is always displayed at 0.