# ToULong(EntityId)

> Gets the raw data of the EntityId. (Use at your own risk. And bit arrangement might change.)

## Definition

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

```csharp
public static ulong ToULong(EntityId entityId)
```

### Parameters

**** (\[EntityId]\(/engine/6000.5/script-reference/unityengine/entityid)): EntityId to get as a ulong.

### Returns

| Type                                                          | Description                                                                             |
| ------------------------------------------------------------- | --------------------------------------------------------------------------------------- |
| [ulong](https://learn.microsoft.com/dotnet/api/system.uint64) | The raw data of the EntityId. (Use at your own risk. And bit arrangement might change.) |

### Remarks

This can be used for storing an [EntityId](/engine/6000.5/script-reference/unityengine/entityid.md) in a common variable, or for custom serialisation.
