---
title: GKEntity
framework: gameplaykit
role: symbol
role_heading: Class
path: gameplaykit/gkentity
---

# GKEntity

An object relevant to gameplay, with functionality entirely provided by a collection of component objects.

## Declaration

```swift
class GKEntity
```

## Overview

Overview A GKEntity object represents an entity in games with Entity-Component architecture. In this design, an entity is a general type for objects relevant to the game. Entities typically define no functionality of their own—instead, you define an entity’s features through composition, by adding components that each handle specific aspects of an entity’s behavior in a general way. Because components (GKComponent subclasses) are general and reusable, you can add many kinds of entities to a game by combining components in different ways, without needing to design new entity classes. For more information on Entity-Component architecture, read Entities and Components in GameplayKit Programming Guide.

## Topics

### Creating an Entity

- [init()](gameplaykit/gkentity/init().md)

### Managing an Entity’s List of Components

- [components](gameplaykit/gkentity/components.md)
- [addComponent(_:)](gameplaykit/gkentity/addcomponent(_:).md)

### Performing Periodic Updates

- [update(deltaTime:)](gameplaykit/gkentity/update(deltatime:).md)

### Instance Methods

- [component(ofType:)](gameplaykit/gkentity/component(oftype:).md)
- [removeComponent(ofType:)](gameplaykit/gkentity/removecomponent(oftype:).md)

### Initializers

- [init(coder:)](gameplaykit/gkentity/init(coder:).md)

## Relationships

### Inherits From

- [NSObject](objectivec/nsobject-swift.class.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)
- [NSCopying](foundation/nscopying.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [NSSecureCoding](foundation/nssecurecoding.md)

## See Also

### Entities and Components

- [GKComponent](gameplaykit/gkcomponent.md)
- [GKComponentSystem](gameplaykit/gkcomponentsystem.md)
