//Attack the enemy if is on range public void AttackEnemy() { if (Time.time > attackNextFire) { attackNextFire = Time.time + attackRate; Attack(_target.GetComponent <CharacterStats>()); } }