# Prefabs

Prefabs are a tool that helps with management and optimization of a space by creating assets that work much like a template object. ***When you update the Prefab,*****&#x20;all&#x20;*****assets in your space will be updated as well.***

If you plan on using the one asset in multiple places in your environment, then it is recommended to use Prefabs to do so.

This improves performance as well as prefabs placed in a space act like *instances* of the asset, which allows Unity to render them to the space with less resources than if you placed the same model in the space manually.

## Setting up a Prefab

Setting up a prefab is as easy as dragging the asset from the Hierarchy to the Project folder. It's recommended to have a folder in your Project labelled Prefabs, and then drag your assets into that.

![Creating a Prefab](/files/hDnXpzZdcXIhcKH3jb0K)

## Updating your Prefab

There are several ways to update a prefab, and therefore all the assets in the space that use that prefab. Which one you choose completely depends on your process, but will basically come down to two results, editing in Context and editing in Isolation.

***In Context*** will open the prefab in the space, so you can see the space around the asset if that is important or useful to visualise next to the asset.

***In Isolation*** will open the prefab in it's own space, so you know exactly what is included in the Prefab itself.

### Method 1

![Editing the prefab with Right Click](/files/eTTrpeqxPo7q1aEVU8gN)

Right mouse click the prefab asset in the Hierarchy, and use either :&#x20;

* Prefab > Open Asset in Context
* Prefab > Open Asset in Isolation

This will open the asset itself allowing you to edit it as you see fit. Once you return to the main space (at the top left) all instances of the Prefab will also be updated.

### Method 2

Click on the arrow to the right of the asset in the Hierarchy to open the asset in context. If you hold the Alt key it will open in Isolation.

![Editing the prefab using the Arrow](/files/FhheKGdpJKiKhLWQbesA)

### Method 3

It is possible to update the Prefab *after* you have edited the asset in the space using the Overrides pulldown at the top right of the Inspector on the prefab itself with the blue box (not the asset you have edited if it is a child of the prefab).&#x20;

It is also possible to revert back to the original prefab if you do not like the changes you have applied.

![Editing a Prefab using Overrides](/files/ffUvfw46qzOqOxbt32o4)

### Method 4

Double click the Prefab in the Project to open it in Isolation.

![Editing a Prefab by Double Clicking](/files/zBwNH6B2cOD9FD1xIWf3)

### Method 5

Use the Open button on the prefab at the top of the inspector. It is also possible to select the Prefab asset in the Project with the Select button next to it if required.

![Editing a prefab using the Open Button](/files/lcsOJSvntRCyUfDfFOeo)

## Returning to your Space

After you have edited your Prefab, you can usually return to the Space itself by using the Top Left of the Space window.

![Return to editing your space](/files/LoaDahQXNIlSNijiO40C)

## Removing an Asset from the Prefab

Occasionally you may want to remove an asset from the Prefab itself. You do this by Right clicking on the gameobject in question and use :&#x20;

* Prefab > Unpack
* Prefab > Unpack Completely

Unpack Completely will remove *all* prefabs within the asset, whereas Unpack will remove the links to the prefab on the gameobject in question.

This is useful on assets that produce a warning about editing Prefabs or Nested prefabs, and removes the warning. However note that the asset is no longer a prefab, and will not benefit from their advantages unless you make it a prefab again and use it as the Template.

## Unique Prefabs

It is possible to make variations on Prefabs without updating the prefab itself. These are done using what are called *Overrides*, and can be applied to the following elements of a Prefab.

* Overriding the value of a property
* Adding a component
* Removing a component
* Adding a child GameObject

To do this all you have to do is modify the asset directly and then make sure you do NOT update the prefab itself. Any overrides to the prefab will be visible in bold, and the Prefab icon (the blue box) may have a Plus on it notifying you that the asset has been modified.

An overridden property will always have priority over updates you make to the original prefab.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.monaverse.com/create/building-spaces/optimise-your-space/prefabs.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
