<!--
{
  "availability" : [
    "iOS: 9.0.0 -",
    "iPadOS: 9.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.11.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "GameplayKit",
  "identifier" : "/documentation/GameplayKit/GKGridGraphNode",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "GameplayKit"
    ],
    "preciseIdentifier" : "c:objc(cs)GKGridGraphNode"
  },
  "title" : "GKGridGraphNode"
}
-->

# GKGridGraphNode

A node in a navigation graph, associated with a position on a discrete two-dimensional grid.

```
class GKGridGraphNode
```

## Overview

Together, a network of nodes form a graph that describes the navigability of a game world. Use graph nodes with a [`GKGridGraph`](/documentation/GameplayKit/GKGridGraph) object (and methods of its superclass [`GKGraph`](/documentation/GameplayKit/GKGraph)) to perform actions that relate to the network of nodes as a whole, such as pathfinding to determine routes through the network.

To learn more about graphs and pathfinding, see [Pathfinding](https://developer.apple.com/library/archive/documentation/General/Conceptual/GameplayKit_Guide/Pathfinding.html#//apple_ref/doc/uid/TP40015172-CH3) in [GameplayKit Programming Guide](https://developer.apple.com/library/archive/documentation/General/Conceptual/GameplayKit_Guide/index.html#//apple_ref/doc/uid/TP40015172).

## Topics

### Creating a Graph Node

[`-  initWithGridPosition:`](/documentation/GameplayKit/GKGridGraphNode/init(gridPosition:))

Initializes a graph node with the specified position on a grid.

[`+  nodeWithGridPosition:`](/documentation/GameplayKit/GKGridGraphNode/nodeWithGridPosition:)

Creates a graph node with the specified position on a grid.

### Inspecting a Node’s Position

[`gridPosition`](/documentation/GameplayKit/GKGridGraphNode/gridPosition)

The position of the node on a discrete integer grid.

## Relationships

### Conforms To

[`CVarArg`](/documentation/Swift/CVarArg)

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

[`Hashable`](/documentation/Swift/Hashable)

[`NSSecureCoding`](/documentation/Foundation/NSSecureCoding)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`NSCoding`](/documentation/Foundation/NSCoding)

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

[`Equatable`](/documentation/Swift/Equatable)

### Inherits From

[`GKGraphNode`](/documentation/GameplayKit/GKGraphNode)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)