Version: 2019.3
LanguageEnglish
  • C#
Method group is Obsolete

PrefabUtility.CreatePrefab

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

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

Parameters

pathThe path where the Prefab is saved.
goThe 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.