---
title: GKSKNodeComponent
framework: gameplaykit
role: symbol
role_heading: Class
path: gameplaykit/gksknodecomponent
---

# GKSKNodeComponent

A component that manages a SpriteKit node.

## Declaration

```swift
class GKSKNodeComponent
```

## Overview

Overview Adding a GKSKNodeComponent object to an entity automatically updates the entity property of the component’s SpriteKit node (an 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 object to manage the relationship between that SpriteKit node and the GKEntity object that node represents. Load the scene file with the GKScene class to access these entities and components. tip: The GKSKNodeComponent class adopts the GKAgentDelegate protocol. If you use the GKAgent2D class to drive the movement of game entities, set your 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 in GameplayKit Programming Guide.

## Topics

### Creating a SpriteKit Component

- [init(node:)](gameplaykit/gksknodecomponent/init(node:).md)

### Accessing the Component’s SpriteKit Node

- [node](gameplaykit/gksknodecomponent/node.md)

## Relationships

### Inherits From

- [GKComponent](gameplaykit/gkcomponent.md)

### Conforms To

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

## See Also

### Xcode and SpriteKit Integration

- [GKScene](gameplaykit/gkscene.md)
- [GKSceneRootNodeType](gameplaykit/gkscenerootnodetype.md)
