Game Development Reference
// The random point is any area within the NavMesh
FinalDest = NavigationHandle.
// Draw the line to our pawn
/** Draw a red sphere to illustrate the next location
will stop at */
The debug information is now drawn on screen so that we can see where our bot will
go. This visualization makes it far easier to understand if our bot is handling our code
correctly or not, especially the pathfinding.
The following code represents what goes on behind the scenes, or within our bot's
mind as it is looking for a new path. All of the pathfinding code is as follows:
// While our bot hasn't reached the random point yet...
/** If the bot realizes it can't reach this point
// Get out of here and pick another point
// Move to the random point
// Rest for (X) seconds before picking a new point
// Start from the beginning again