---
title: GetEntity()
product: Unity Editor
version: '7000.0'
latest_version: '7000.0'
status: This page documents version 7000.0. The latest version is 7000.0.
canonical: https://docs.unity.com/en-us/engine/7000.0/script-reference/unityengine/gameobject/getentity
latest_url: https://docs.unity.com/en-us/engine/7000.0/script-reference/unityengine/gameobject/getentity.md
last_updated: 2026-11-30
generated_at: 2026-12-01T07:18:41.440Z
locale: en-us
---

# GetEntity()

> Gets the entity that stores this GameObject's components in a World.

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine](/engine/7000.0/script-reference/unityengine.md)
* **Assembly:** [UnityEngine.CoreModule](/engine/7000.0/script-reference/modules/unityengine-coremodule.md)

```csharp
public Entity GetEntity()
```

### Returns

| Type                                                               | Description                                                                                                                               |
| ------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------- |
| [Entity](/engine/7000.0/script-reference/unity/entities/entity.md) | The entity, with the same index and version as [Object.GetEntityId()](/engine/7000.0/script-reference/unityengine/object/getentityid.md). |

### Remarks

Use the entity with `Unity.Entities.GlobalEntityManager` to access the data components of the GameObject. When collections checks are enabled, this method throws an `ArgumentException` if the GameObject has been destroyed, so its entity doesn't exist.
