This version of Unity is unsupported.
Method group is Obsolete

PrefabUtility.CreatePrefab

Obsolete Use SaveAsPrefabAsset instead.

Declaration

public static GameObject CreatePrefab(string path, GameObject go);
Obsolete Use SaveAsPrefabAsset or SaveAsPrefabAssetAndConnect instead.

Declaration

public static GameObject CreatePrefab(string path, GameObject go, ReplacePrefabOptions options);

Parameters

path The path where the Prefab is saved.
go The GameObject that you want to create a Prefab from.

Returns

GameObject A reference to the created Prefab.

Description

Creates a Prefab from a game object hierarchy.

Use this to create a Prefab from a GameObject in the hierarchy, and give it a path to save the Prefab in.