# implicit operator int

> Implicitly converts an EntityId to an integer.

## Definition

* **Type:** Operator
* **Namespace:** [UnityEngine](/engine/6000.3/script-reference/unityengine.md)
* **Assembly:** UnityEngine.CoreModule

## implicit operator int(Int3)

Implicitly converts an `EntityId` to an integer.

```csharp
public static implicit operator int(EntityId entityId)
```

### Parameters

**** (\[EntityId]\(/engine/6000.3/script-reference/unityengine/entityid)): The `EntityId` to convert.

### Returns

| Type                                                       | Description                                   |
| ---------------------------------------------------------- | --------------------------------------------- |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | The integer representation of the `EntityId`. |

### Remarks

This conversion exists for backward compatibility with code that contains object identifiers in integers. The resulting integer is an implementation detail: don't inspect its bits, check its sign, or sort by it.

## implicit operator EntityId(EntityI)

Implicitly converts an integer to an `EntityId`.

```csharp
public static implicit operator EntityId(int intValue)
```

### Parameters

**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The integer value to convert.

### Returns

| Type                                                                | Description                                             |
| ------------------------------------------------------------------- | ------------------------------------------------------- |
| [EntityId](/engine/6000.3/script-reference/unityengine/entityid.md) | An `EntityId` representing the specified integer value. |

### Remarks

This conversion exists for backward compatibility with code that contains object identifiers in integers. Use `EntityId` values directly where possible.
