void OnTriggerEnter(Collider other) { if (other.gameObject.CompareTag("Enemy") && timer >= timeBetweenDamage) { Hit (10); } }