# GetIconForGameObject(GameObject)

> Retrieves the icon for the given GameObject.

## Definition

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

```csharp
public static Texture2D GetIconForGameObject(GameObject gameObject)
```

### Parameters

**** (\[GameObject]\(/engine/6000.6/script-reference/unityengine/gameobject)): The GameObject to get an icon for.

### Returns

| Type                                                                  | Description                  |
| --------------------------------------------------------------------- | ---------------------------- |
| [Texture2D](/engine/6000.6/script-reference/unityengine/texture2d.md) | The icon for the GameObject. |

### Remarks

This method returns the icon for the GameObject, as it appears in the Hierarchy or Project Browser. Prefab instance or Asset roots have a Prefab, Prefab Mode, or Prefab Variant icon, while other GameObjects have a regular GameObject icon.
