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

# GKSKNodeComponent

A component that manages a SpriteKit node.

```
class GKSKNodeComponent
```

## Overview

Adding a [`GKSKNodeComponent`](/documentation/GameplayKit/GKSKNodeComponent) object to an entity automatically updates the <doc://com.apple.documentation/documentation/SpriteKit/SKNode/entity> property of the component’s SpriteKit node (an <doc://com.apple.documentation/documentation/SpriteKit/SKNode> object) to point to that entity.

When you add entities and components to a node in the Xcode SpriteKit scene editor, Xcode automatically creates a [`GKSKNodeComponent`](/documentation/GameplayKit/GKSKNodeComponent) object to manage the relationship between that SpriteKit node and the [`GKEntity`](/documentation/GameplayKit/GKEntity) object that node represents. Load the scene file with the [`GKScene`](/documentation/GameplayKit/GKScene) class to access these entities and components.

> Tip:
> The ``doc://com.apple.gameplaykit/documentation/GameplayKit/GKSKNodeComponent`` class adopts the ``doc://com.apple.gameplaykit/documentation/GameplayKit/GKAgentDelegate`` protocol. If you use the ``doc://com.apple.gameplaykit/documentation/GameplayKit/GKAgent2D`` class to drive the movement of game entities, set your ``doc://com.apple.gameplaykit/documentation/GameplayKit/GKSKNodeComponent`` instance as the delegate for the entity’s agent, and GameplayKit will automatically synchronize the agent and its SpriteKit representation.

For more information on Entity-Component architecture, read [Entities and Components](https://developer.apple.com/library/archive/documentation/General/Conceptual/GameplayKit_Guide/EntityComponent.html#//apple_ref/doc/uid/TP40015172-CH6) 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 SpriteKit Component

[`+  componentWithNode:`](/documentation/GameplayKit/GKSKNodeComponent/componentWithNode:)

Creates a component to manage the specified SpriteKit node.

[`-  initWithNode:`](/documentation/GameplayKit/GKSKNodeComponent/init(node:))

Initializes a component to manage the specified SpriteKit node.

### Accessing the Component’s SpriteKit Node

[`node`](/documentation/GameplayKit/GKSKNodeComponent/node)

The SpriteKit node managed by the component.

## Relationships

### Conforms To

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

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

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

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

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

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

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

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

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

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

### Inherits From

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

---

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)