A single node in a navigation graph for use in pathfinding.
- iOS 9.0+
- macOS 10.11+
- Mac Catalyst 13.0+Beta
- tvOS 9.0+
A set of connected nodes form a graph that describes the navigability of a game world. Use graph nodes together with a
GKGraph object (or one of its subclasses) to perform actions that relate to the network of nodes as a whole, such as pathfinding to determine routes through the network.
This class describes the general features of graph nodes, but does not contain geometry information that relates the graph to a game world. You can construct a graph with this class or any of its subclasses:
On its own, the
GKGraphclass is useful for worlds such as board games, where the connections between nodes are important but their spatial position has no effect on gameplay.
GKGraphobjects to model worlds that allow full freedom of movement in a two-dimensional plane. Use these nodes together with the
GKMeshclass to create graphs that route around impassable obstacles.
GKGraphobjects to model worlds that allow full freedom of movement in three-dimensional space.