To edit a PrefabAn asset type that allows you to store a GameObject complete with components and properties. The prefab acts as a template from which you can create new object instances in the scene. More info
See in Glossary Asset, open it in Prefab Mode. Prefab Mode allows you to view and edit the contents of the Prefab Asset in isolation, separately from any other objects in your SceneA Scene contains the environments and menus of your game. Think of each unique Scene file as a unique level. In each Scene, you place your environments, obstacles, and decorations, essentially designing and building your game in pieces. More info
See in Glossary. Changes you make in Prefab Mode affect all instances of that Prefab.
There are many ways to begin editing a Prefab in Prefab Mode, including:
Entering Prefab Mode makes the Scene ViewAn interactive view into the world you are creating. You use the Scene View to select and position scenery, characters, cameras, lights, and all other types of Game Object. More info
See in Glossary and the Hierarchy window show only the contents of that Prefab. Here, the root of the Prefab is a regular GameObjectThe fundamental object in Unity scenes, which can represent characters, props, scenery, cameras, waypoints, and more. A GameObject’s functionality is defined by the Components attached to it. More info
See in Glossary - it doesn’t have the blue Prefab instances icon.
In Prefab Mode, the Scene View displays a breadcrumb bar at the top. The rightmost entry is the currently open Prefab. Use the breadcrumb bar to navigate back to the main Scenes or other Prefab Assets that you might have opened.
Additionally, the Hierarchy window displays a Prefab header bar at the top which shows the currently open Prefab. You can use the back arrow in the header bar to navigate back one step, which is equivalent to clicking the previous breadcrumb in the breadcrumb bar in the Scene View.
Prefab Mode has an Auto Save setting in the top right corner of the Scene View. When it is enabled, any changes that you make to a Prefab are automatically saved to the Prefab Asset. Auto Save is on by default.
If you want to make changes without automatically saving those changes to the Preset Asset, turn Auto Save off. In this case, you are asked if you want to save unsaved changes or not when you go out of Prefab Mode for the current Prefab. If editing a Prefab in Prefab Mode seems slow, turning off Auto Save may help.
You can assign a Scene as an editing environment to Prefab Mode, which allows you to edit your Prefab against a backdrop of your choosing rather than an empty Scene. This can be useful for seeing how your Prefab looks against typical scenery in your game.
The objects in the Scene that you assign as the editing environment are not selectable when in Prefab Mode, nor will they show in the Hierarchy. This is to allow you to focus on editing your Prefab without accidently selecting other unrelated objects, and without having a cluttered Hierarchy window.
To set a Scene as the editing environment, open the Editor window (top menu: Edit > Project Settings, then select the Editor category) and go to the Prefab Editing Environment section. Use the Regular Environment setting for “non-UI” Prefabs, and the UI Environment setting for UI Prefabs. UI prefabs are those Prefabs that have a Rect Transform component on the root, rather than a regular Transform component. “non-UI” Prefabs are those which have a regular Transform component.
2018–07–31 Page published with limited editorial review
Nested Prefabs and Prefab Variants added in 2018.3
Did you find this page useful? Please give it a rating: