Need AI script that makes object follow the player (and collidors work)

I have this code till now,

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;
 
 
}

I have made videos on exactly what you are asking. Your script is exactly like at video 23 :

And I have just taken a break from recording more videos to see your question. So check out all my videos on Programming and Making Games with Unity 3D : Alucard Jay - YouTube