© Sebastiano M. Cossu 2021
S. M. CossuBeginning Game AI with Unityhttps://doi.org/10.1007/978-1-4842-6355-6_3

3. Paths and Waypoints

Sebastiano M. Cossu1  
(1)
LONDON, UK
 

In the last chapter, we saw how we can create a 3D object and make it move around and toward a specific point in the space. As you might expect, that code won’t work in a complex context; for example, if you put the little cube in a maze, it will never be able to get to the goal coordinates. This kind of problem falls under the category of pathfinding, which focuses on finding optimal paths in a graph. Pathfinding can be used to solve nearly every problem as long as it’s represented as a graph problem.

In this chapter, we will see how we can tackle pathfinding problems using fundamental ...

Get Beginning Game AI with Unity: Programming Artificial Intelligence with C# 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.