How do I make basic follow ai stay

How do I make it so the objects stay in 2d and not rotate to look at the player?

var target : Transform; //the enemy's target
var moveSpeed = 3; //move speed
var rotationSpeed = 3; //speed of turning
 
var myTransform : Transform; //current transform data of this enemy
 
function Awake()
{
    myTransform = transform; //cache transform data for easy access/preformance
}
 
function Start()
{
     target = GameObject.FindWithTag("Player").transform; //target the player
 
}
 
function Update () {
    //rotate to look at the player
    myTransform.rotation = Quaternion.Slerp(myTransform.rotation,
    Quaternion.LookRotation(target.position - myTransform.position), rotationSpeed*Time.deltaTime);
 
    //move towards the player
    myTransform.position += myTransform.forward * moveSpeed * Time.deltaTime;
 
 
}

Assuming this is 2D game with 2D sprites or Quads played on the XY plane, then you are probably looking for something like this:

function Update () {
    //rotate to look at the player
    var dir = target.position - myTransform.position
    var angle = Mathf.Atan2(dir.y, dir.x) * Mathf.Rad2Deg;
    var q = Quaternion.AngleAxis(angle, Vector3.forward);
    myTransform.rotation = Quaternion.Slerp(myTransform.rotation, q, rotationSpeed*Time.deltaTime);
 }

This code assumes that ‘forward’ is to the right. If it is up, then either change the sprite in Photoshop, or add 90 to ‘angle’ before doing the AngleAxis() call.