private void OnTriggerStay(Collider col) { if (col.gameObject.tag == playerTag) { if (timer >= attackCooldown) { TowerStats stats = col.gameObject.GetComponent <TowerStats>(); stats.Hit(damage); enemyStats.Hit(damage); timer = 0; } } timer += Time.deltaTime; }