Testing all the components

Now that we've looked at how everything is wired up, hit the play button and observe how a path will be drawn from our start node to our goal node, as shown in the following screenshot:

Since we're checking for the path at intervals inside the Update loop, we can move the goal node in play mode, and see the path updated. The following screenshot shows the new path after moving our goal node to a different location:

As you can see, since the goal is closer, so is the most optimal path to reach it. In a little more ...

Get Unity 2017 Game AI Programming - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.