Game Development Reference
// Calls all of the Tick functions from parent classes
// If there is a pawn on the map....
if (Pawn != None)
/** Then call this method, which initializes our
The PathFind() function is where all of the math for our pathfinding occurs.
We're making use of that Distance variable (integer), and defining it as the
difference in distance between our bot's current location and the location of
the PathNodes in our array.
If we are within a predetermined distance (the CloseEnough variable), then
we instruct the bot to move towards the next node in the array, as noted by _
PathNode++; . If we've iterated through each of the nodes, then start back
at 0. Once that is done we move to the PathFinding state .
* The meat-and-potatoes of the class.
* This is where all of the logic occurs
simulated function PathFind()
local int Distance;
/** Distance between our pawn's current location and
PathNode in our array */
Distance = VSize2D(Pawn.Location -
if (Distance <= CloseEnough)
// Interate through the next node in our array
// If we've gone through all of the nodes in our
if (_PathNode >= WayPoints.Length)