# IsPartOfPrefabInstance(Object)

> Returns true if the given object is part of a Prefab instance.

## Definition

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

```csharp
public static bool IsPartOfPrefabInstance(Object componentOrGameObject)
```

### Parameters

**** (\[Object]\(/engine/6000.7/script-reference/unityengine/object)): The object to check. Must be a component or GameObject.

### Returns

| Type                                                          | Description                                      |
| ------------------------------------------------------------- | ------------------------------------------------ |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | True if the object is part of a Prefab instance. |

### Remarks

It also returns true if the given object is part of Prefab instance that is inside a Prefab Asset. In that case both [PrefabUtility.IsPartOfPrefabAsset](/engine/6000.7/script-reference/unityeditor/prefabutility/ispartofprefabasset.md) and [PrefabUtility.IsPartOfPrefabInstance](/engine/6000.7/script-reference/unityeditor/prefabutility/ispartofprefabinstance.md) will return true.

If the given object is part of a Prefab instance where the asset is missing, it will still return true.

To know if a given object is part of a Prefab instance but not part of a Prefab Asset, use [PrefabUtility.IsPartOfNonAssetPrefabInstance](/engine/6000.7/script-reference/unityeditor/prefabutility/ispartofnonassetprefabinstance.md).
