How to fix targeting Problem

I have a Player with a script. This script uses overlapSphere to look for Enemy Objects. The Problem is that it is not looking onto the nearest Enemy. What shoul I do ? Pls help.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Attack : MonoBehaviour
{
    [SerializeField] private float range;
    public Transform EnemyG;

     void Update()
    {
        Collider[] colliderArray = Physics.OverlapSphere(transform.position, range);
        foreach(Collider collider in colliderArray)
        {
            if (collider.TryGetComponent<Enemy>(out Enemy enemy))
            {
                transform.LookAt(EnemyG);
            }
        }
    }
}

You are using a foreach() loop. Even if it finds the closest enemy, the code still continues and it will select the last enemy in the array. You can put “break;” in the if statement to stop the foreach loop from continuing.

Dumb question- how can I add break ?