void CheckDistanceToPlayer() { float distance = Vector2.Distance(this.transform.position, _playerObject.position); if (distance <= _attackRange) { //If the enemy is in attack range, stop moving and attack _move.CanMove = false; _anims.AttackAnimation(); } }