void checkHealth() { if (health <= 0 && isAlive) { isAlive = false; Debug.Log("I died"); Player.GetComponent <Movement>().killCount += 1; this.gameObject.GetComponent <CapsuleCollider>().enabled = false; this.gameObject.GetComponent <NavMeshAgent>().enabled = false; this.gameObject.GetComponent <EnemyBaseActions>().enabled = false; zombieAnim.ZombieDie(); if (dieWait <= 0) { Destroy(this.gameObject); } else { dieWait -= Time.deltaTime; } } }