---
title: GKGraphNode2D
framework: gameplaykit
role: symbol
role_heading: Class
path: gameplaykit/gkgraphnode2d
---

# GKGraphNode2D

A node in a navigation graph, associated with a point in continuous 2D space.

## Declaration

```swift
class GKGraphNode2D
```

## Overview

Overview Together, a network of nodes form a graph that describes the navigability of a game world. Use graph nodes with a GKGraph, GKObstacleGraph, or GKMeshGraph object to perform actions that relate to the network of nodes as a whole, such as pathfinding to determine routes through the network. When you use the GKObstacleGraph or GKMeshGraph class to describe a game world in terms of open spaces interrupted by obstacles, GameplayKit automatically creates and manages GKGraphNode2D instances that represent positions along possible paths that navigate around those obstacles. To learn more about graphs and pathfinding, see Pathfinding in GameplayKit Programming Guide.

## Topics

### Creating a Graph Node

- [init(point:)](gameplaykit/gkgraphnode2d/init(point:).md)
- [node(withPoint:)](gameplaykit/gkgraphnode2d/node(withpoint:).md)

### Inspecting a Node’s Position

- [position](gameplaykit/gkgraphnode2d/position.md)

## Relationships

### Inherits From

- [GKGraphNode](gameplaykit/gkgraphnode.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSCoding](foundation/nscoding.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [NSSecureCoding](foundation/nssecurecoding.md)

## See Also

### Pathfinding

- [GKGraph](gameplaykit/gkgraph.md)
- [GKObstacleGraph](gameplaykit/gkobstaclegraph.md)
- [GKMeshGraph](gameplaykit/gkmeshgraph.md)
- [GKGridGraph](gameplaykit/gkgridgraph.md)
- [GKGraphNode](gameplaykit/gkgraphnode.md)
- [GKGraphNode3D](gameplaykit/gkgraphnode3d.md)
- [GKGridGraphNode](gameplaykit/gkgridgraphnode.md)
