# FindPrefabRoot(GameObject)

> Retrieves the root GameObject of the Prefab that the supplied GameObject is part of.

## Definition

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

> **Warning:**
>
> **Deprecated.** Use GetOutermostPrefabInstanceRoot if source is a Prefab instance or source.transform.root.gameObject if source is a Prefab Asset object.

```csharp
public static GameObject FindPrefabRoot(GameObject source)
```

### Parameters

**** (\[GameObject]\(/engine/6000.7/script-reference/unityengine/gameobject)): The object to check.

### Returns

| Type                                                                    | Description      |
| ----------------------------------------------------------------------- | ---------------- |
| [GameObject](/engine/6000.7/script-reference/unityengine/gameobject.md) | The Prefab root. |

### Remarks

This method checks if the object is part of a Prefab (either a Prefab instance or a Prefab Asset) and if so, returns the root GameObject of the Prefab.

This method is used internally in the Editor to help the user select the correct object when GameObjects are clicked in the Scene view.
