Creating a prefab
Set up your GameObject
In the scene, create and configure the GameObject you want to turn into a prefab — add components, child objects, and set properties as needed.
Prefabs in the scene
Prefab instances in the scene appear in a distinct colour to make them easy to identify at a glance.When a GameObject is in its Prefab Instantiation state, you cannot view or select objects inside its hierarchy. To edit the contents directly in the scene, right-click the prefab and choose Unlink from Prefab to convert it to regular GameObjects.
Instantiating prefabs at runtime
Reference a prefab in your component using aGameObject property and drag a PrefabFile asset into the slot in the Inspector:
BreakFromPrefab() on it if you want to detach the instance and treat it as a standalone set of GameObjects:
Updating a prefab
Edit thePrefabFile asset directly — open it from the asset browser or double-click a prefab instance in the scene. When you save your changes, all instances of the prefab in all open scenes update to reflect the new configuration.