i have a script wich moves a ai character towards the player. the problem is that even though i change the move speed variable it does not seem to matter. the enemy still moves really fast.
#pragma strict
var player : GameObject;
var moveSpeed : float = 0.000001;
var detectDistance : float = 10;
var minDistance : float = 1.5;
function Start () {
player = GameObject.FindGameObjectWithTag("Player");
}
function Update () {
var distance = Vector3.Distance(gameObject.transform.position, player.transform.position);
if(distance >= minDistance && distance <= detectDistance){
Debug.DrawLine(player.transform.position, gameObject.transform.position, Color.red);
gameObject.transform.LookAt(player.transform);
gameObject.transform.Translate(Vector3.forward * Time.deltaTime * moveSpeed, Space.Self);
}else{
Debug.DrawLine(player.transform.position, gameObject.transform.position, Color.green);
}
}