I'am using Arons A* pathfinding.
I want a character to move from one point to another. I'am just starting with unity and these are my first scripts.
The script doesn't give any errors, but it doesn't work.
What is wrong?
var target : Transform[];
var timer : float = 0.0;
var Rate : float = 1.0;
private var currentTarget: int;
function FixedUpdate () {
timer += Time.deltaTime;
if(timer > Rate){
this.GetComponent("Seeker").StartPath(transform.position,target[currentTarget].position);
timer = 0;
}
if(Vector3.Distance(transform.position,target[currentTarget].position)<=0){
currentTarget++;
if(currentTarget>=target.Length){
currentttarget = 0;
}
}
}