public void Hit() { if (!dead) { MS.MonsterKilled(); dead = true; anim.SetBool("IsDead", true); GetComponent <CapsuleCollider>().enabled = false; agent.isStopped = true; } }