In the inspector i cannot change the movement speed ,rotation speed or distance the enemy attacks.You think that could be a bug or something wrong with my ai script? Here is my script.
using UnityEngine;
using System.Collections;
public class EnemyAI : MonoBehaviour {
public Transform target;
public int movespeed;
public int rotationspeed;
public int maxDistance;
private Transform myTransform;
void Awake() {
myTransform = transform;
}
void Start () {
GameObject go = GameObject.FindGameObjectWithTag("Player");
target = go.transform;
maxDistance = 100;
}
void Update () {
myTransform.rotation = Quaternion.Slerp(myTransform.rotation,Quaternion.LookRotation(target.position - myTransform.position),rotationspeed* Time.deltaTime);
if(Vector3.Distance(target.position, myTransform.position) > maxDistance) {
myTransform.position += myTransform.forward * movespeed * Time.deltaTime;
}
}
}