Documentation 2017-10-17T07:17:19+00:00

Creating a nested prefab

To create a new Nested Prefab simply drag a prefab (Prefab B) into the hierarchy of another prefab (Prefab A) and apply the changes to the root prefab (Prefab A).

Applying changes to a nested prefab

1. Inspector Apply button

Will apply changes to the nested prefab, all other nested prefabs in the hierarchy of the root prefab, and the root prefab itself.

2. Right-click on the nested prefab icon and choose “Apply Prefab”

Will apply changes to the nested prefab. Does not apply changes to any other (nested) prefabs in the hierarchy.

3. Right-click on the nested prefab icon and choose “Apply Prefab and Children”

Will apply changes to the nested prefab and any other nested prefabs that are part of the nested prefab’s hierarchy (children).

4. Right-click on the nested prefab icon and choose “Apply All”

Has the same effect as clicking Apply in the inspector and will apply changes to all (nested) prefabs in the hierarchy, including the root prefab.

Reverting a nested prefab

To revert a nested prefab you can use either the Revert button in the Inspector, or the revert buttons in the context menu that opens when right-clicking on the nested prefab’s icon in the hierarchy. The affected prefabs in the hierarchy are the same as when applying changes (see above).

Breaking a nested prefab connection

If you decide you no longer need a nested prefab connection you can choose ‘Break Prefab Connection’ in the context menu to completely remove the prefab connection. All the objects will stay in the hierarchy and will now be part of the parent prefab instead.

Note: This change is applied immediately to all instances and cannot be undone.

Overriding a property in a nested prefab

It is possible to override a property in a nested prefab and save it, without applying the property to the original prefab when you click apply.

To do this you have to add a PrefabOverrides component to the nested prefab in which you want to override a property.
In the Prefab Overrides component, you can click ‘Add Override’ to add a new property to override.

In the example on the right the ‘Ok’ and ‘Cancel’ buttons are the same prefab, however, the text of the ‘Cancel’ button is overridden.

Note: Prefab Overrides can only be added to a nested prefab and not to the root of a prefab.