How to prevent arcing rotation?

Hello, I am trying to write a very simple AI script that should have the AI object rotate to face the player. My code works except the AI rotates with an arc and I don’t understand why. I want it to sit still and rotate around it’s own y axis so that it always faces the player. Here is my code:

function Update () {
 
myTransform.rotation = Quaternion.Slerp(myTransform.rotation, Quaternion.LookRotation(target.position - myTransform.position), rotationSpeed * Time.deltaTime);
myTransform.eulerAngles = Vector3(0, transform.eulerAngles.y, 0);
 
 
}

Also I should point out I want this to work without the use of a character controller. Can someone give me an idea how to make this work properly? Thank you!

Try with Transform.LookAt - Unity - Scripting API: Transform.LookAt.

Does this have the same effect:

 myTransform.eulerAngles.y = Mathf.LerpAngle(myTransform.eulerAngles.y, Quaternion.LookRotation(target.position - myTransform.position).eulerAngles.y, rotationSpeed * Time.deltaTime);

I figured out a workaround. For some reason if I create an empty gameobject and attaach the ai script to it and child the ai gameobject to it it works perfectly. Thanks for the help anyway guys!