Add Pathfinding to Your Game

Pathfinding is a big topic, so it won’t be possible to cover everything. However, this section aims to give you enough information to get started with it.

You started this project in Configure the View and Load the Scene, in which you were instructed to pay little attention to the GameplayKit-related code, including the GKScene’s graphs property.

The graphs property contains the list of the pathfinding graph objects managed by the scene, in other words, the navigation graphs you add to the scene using the Scene Editor.

At the moment, your scene doesn’t contain any navigation graphs, so the first step is to add one and to learn how the Navigation Graph Editor works.

Using the Navigation Graph Editor

Switch to ...

Get Apple Game Frameworks and Technologies 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.