# CompareTo(Entity)

> Compare this entity against a given one

## Definition

* **Type:** Method
* **Namespace:** [Unity.Entities](/engine/7000.0/script-reference/unity/entities.md)
* **Assembly:** UnityEngine.EntitiesModule

```csharp
public int CompareTo(Entity other)
```

### Parameters

**** (\[Entity]\(/engine/7000.0/script-reference/unity/entities/entity)): The other entity to compare to

### Returns

| Type                                                       | Description                                |
| ---------------------------------------------------------- | ------------------------------------------ |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | Difference based on the Entity Index value |
