---
title: entity
framework: gameplaykit
role: symbol
role_heading: Instance Property
path: gameplaykit/gkcomponent/entity
---

# entity

The entity that owns this component.

## Declaration

```swift
weak var entity: GKEntity? { get }
```

## Discussion

Discussion Use this property in a component subclass to refer back to the owning entity and its attributes. An entity may be an instance either of the GKEntity class or of a custom subclass. In the latter case, a custom entity class can provide storage for state or resources accessed by multiple components.

## See Also

### Working with Entities

- [didAddToEntity()](gameplaykit/gkcomponent/didaddtoentity().md)
- [willRemoveFromEntity()](gameplaykit/gkcomponent/willremovefromentity().md)
