Unity Artificial Intelligence Programming - Fourth Edition
by Dr. Davide Aversa, Aung Sithu Kyaw, Clifford Peters
Following a path
A path is a sequence of points in the game, connecting a point, A, to another point, B. There are many ways to build a path. Usually, a path is automatically generated by other game systems, such as pathfinding (see the next chapter); however, in our example, we, use a very basic system: we will construct the path by hand by using waypoints. We will write a script called Path.cs and store all the waypoint positions in a Vector3 array. Then, from the editor, we will enter those positions manually. It's a bit of a tedious process right now, but we don't want to make things too complicated. Fortunately, since the number of waypoints that we are creating here is not that substantial, the operation should not take too much time: ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access