Ok I have this AI over here thats a bit retarded at the moment and this is caused by it not being able to loop its waypoints.
As in it gets to the end of the last way point fine but then throws up the out of range exception. I need a way for it to make the current way point the first in the array again when it gets to the end.
Can you help me with a solution, I have been trying everything and they not working here is the code that so far.
if(inWaypointPath == true && curWaypointDist < 2){
currentWaypoint = currentWaypoint+1;
}
// this is what is not working... This is just one way I tried but failed.
if(currentWaypoint > wayPoints.Count){
currentWaypoint = 0;
}
Thanks.