# ConvertToPrefabInstances(GameObject[], GameObject, ConvertToPrefabInstanceSettings, InteractionMode)

> Convert an array of GameObjects to Prefab instances of the given Prefab Asset.

## Definition

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

```csharp
public static void ConvertToPrefabInstances(GameObject[] plainGameObjects, GameObject prefabAssetRoot, ConvertToPrefabInstanceSettings settings, InteractionMode mode)
```

### Parameters

**** (\[GameObject\[]]\(/engine/6000.6/script-reference/unityengine/gameobject)): The array of GameObjects that will be converted to Prefab instances.**** (\[GameObject]\(/engine/6000.6/script-reference/unityengine/gameobject)): The Prefab Asset used to create the Prefab instances from.**** (\[ConvertToPrefabInstanceSettings]\(/engine/6000.6/script-reference/unityeditor/converttoprefabinstancesettings)): Settings to control the conversion.**** (\[InteractionMode]\(/engine/6000.6/script-reference/unityeditor/interactionmode)): Using UserAction will record undo and show dialogs if needed.

### Remarks

This function is similar to the [PrefabUtility.ConvertToPrefabInstance](/engine/6000.6/script-reference/unityeditor/prefabutility/converttoprefabinstance.md) method, except it will perform the operation on each of the GameObjects in the input.
