Attach animation to Lerpz character

Hi to all

I have Lerpz character(in 2DGemeplayTutorialProject) and attach enemyai script to it and this script not run in Lerp character

but when I attach this script to a Cube this script run

please help me to run this script on Lerpz character

and my enemyai script is here

using UnityEngine; using System.Collections;

public class enemyai : MonoBehaviour { public Transform target; public int movespeed; public int rotationspeed; private Transform mytransform; public int maxdistance; // Use this for initialization void Awake() { mytransform=transform; } void Start () { GameObject go=GameObject.FindGameObjectWithTag(“Player”); target=go.transform; maxdistance=2; }
// Update is called once per frame
void Update () {
Debug.DrawLine(target.transform.position,mytransform.position,Color.black);
//Look at target
Vector3 relativePos = target.position - mytransform.position;
mytransform.rotation=Quaternion.Slerp(mytransform.rotation,
Quaternion.LookRotation(relativePos),rotationspeed*Time.deltaTime);

//move toward target
if(Vector3.Distance(target.position,mytransform.position)>maxdistance)
mytransform.position+=mytransform.forwardmovespeedTime.deltaTime;
}

}

The Lerpz character(in 2DGemeplayTutorialProject) had a movement script already so you will to change this Ai movement script to suit the movement script inside the tutorial…

Use The Lerpz character(in 2DGemeplayTutorialProject) before,I will say the first thing you need to do is understand the platformcontroller in the script that shld provide you hint on how to edit the EnemyAI to suit the tutorial script…

thanks
in my script I want to rotate the head of Lerpz to my character but it is not work!!!