TEMPEST.114 Posted November 26, 2022 Posted November 26, 2022 At any point, tell an AI unit to go immediately to it's NEXT waypoint. If there are no more waypoints left, go back to it's first waypoint. This prevents the need to get and parse the table of waypoints to work out which one it's between and what the next one is (a huge overhead), and whilst 'goToWaypoint(n)' does work, you have to do all the work I've just mentioned to work out which one is the next one. Alternatively, have a 'getNextWaypoint' function that returns the number of the next waypoint. And a 'getTotalNumberOfWaypoints()' function, so we can see where it is in the list and then call 'goToWaypoint()' with the correct number.
Recommended Posts