# EntityIdToObject(EntityId)

> Translates an EntityId to a reference to an object.

## Definition

* **Type:** Method
* **Namespace:** [UnityEditor](/engine/6000.6/script-reference/unityeditor.md)
* **Assembly:** UnityEditor.CoreModule

```csharp
public static Object EntityIdToObject(EntityId entityId)
```

### Parameters

**** (\[EntityId]\(/engine/6000.6/script-reference/unityengine/entityid)):&#x20;

### Returns

| Type                                                            | Description |
| --------------------------------------------------------------- | ----------- |
| [Object](/engine/6000.6/script-reference/unityengine/object.md) |             |

### Remarks

If the object is not loaded from disk, loads it from disk.

![EditorUtilityEntityIdToObject (EntityIdToObject(EntityId))](/api/media?file=/engine/6000.6/media/images/EditorUtilityEntityIdToObject.png)

*Editor Window to find an object, whose EntityId we will use to get and print the name of the object.*

### Examples

```csharp
using UnityEngine;
using UnityEditor;

public class EntityIdToObjectExample : EditorWindow
{
    static Object source;

    [MenuItem("Example/ID To Name")]
    static void Init()
    {
        // Get existing open window or if none, make a new one:
        EntityIdToObjectExample window = (EntityIdToObjectExample)EditorWindow.GetWindow(typeof(EntityIdToObjectExample));
        window.Show();
    }

    void OnGUI()
    {
        source = EditorGUILayout.ObjectField("Entity Id:", source, typeof(Object), true);
        var id = source ? source.GetEntityId() : EntityId.None;
        if (GUILayout.Button("Find Name"))
        {
            Object obj = EditorUtility.EntityIdToObject(id);
            if (!obj)
                Debug.LogError("No object could be found with instance id: " + id);
            else
                Debug.Log("Object's name: " + obj.name);
        }
    }

    void OnInspectorUpdate()
    {
        Repaint();
    }
}
```
