<!--
{
  "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/GKComponent/entity",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "GameplayKit"
    ],
    "preciseIdentifier" : "c:objc(cs)GKComponent(py)entity"
  },
  "title" : "entity"
}
-->

# entity

The entity that owns this component.

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

## 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`](/documentation/GameplayKit/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.

---

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)