What’s wrong with this code? Unity says Assets/EnemyAI.js(9,68): BCE0044: unexpected char: 0xAD.
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 () { var lookDir = target.position - myTransform.position; lookDir.y = 0; // zero the height difference myTransform.rotation = Quaternion.Slerp(myTransform.rotation, Quaternion.LookRotation(lookDir), rotationSpeed*Time.deltaTime); myTransform.position += myTransform.forward * moveSpeed * Time.deltaTime;
}