Hey guys,
Still new to this whole beast. Having a tough time figuring out how to edit my script so it only walks towards the player if the enemy is in X range.
Here is what we have so far:
var target : Transform;
var moveSpeed = 3;
var rotationSpeed = 3;
var myTransform : Transform;
function Awake(){
myTransform = transform;
}
function Start(){
target = GameObject.FindWithTag("Player").transform;
}
function Update(){
transform.LookAt(Vector3(target.position.x, transform.position.y, target.position.z));
myTransform.Translate(Vector3.forward * moveSpeed *Time.deltaTime);
}
Thanks all,
Help Appreciated
-Kav