Prefabs

Overview

Prefabs are groups of objects that can be placed in the level as instances. An instance is an object that is an exact copy of every other object of the same type.

Altering one prefab universally applies the changes to each instance of the prefab object. Any alterations need to be saved to the Prefab library to ensure they are correctly propagated across the entire game.

The Prefabs Library is a part of The DataBase View. It lists all the Prefab objects that are available for a specific level.


An example of two instances of a prefab.

Prefab Logic

Prefabs now support Flowgraph logic, so make sure you check out the Prefab Communication tutorial for more information.

The Prefabs Library

Open the Database View by going to the main menu: View -> Open View Pane -> Database View.

Now, enter the Prefabs Library by clicking its tab at the top of the window.

To create a new library, click the Add Library button and type in a new library name.

Make sure that you click Save Library once you're done.

In order to load an existing prefab library, click the Load Library button and select a library by pressing the Open.

Creating a New Prefab

First, place several objects in the level that you wish to change to a prefab. Select all the objects that you require. Next, on the Prefabs menu, click Make From Selection.

Now, fill in a Group and Name for the new prefab. The prefab will be created in the currently selected library.

The prefab has now been created and is ready to be used in the level.

Prefab Object Parameters

There are several important parameters when working with prefabs.

ParameterDescription
Prefab NameThe name of the prefab, taken from the prefab library. Click on the < icon to open the prefab in Database View.
Object listA list of all the objects within the prefab, alongside their object type.
SubObject infoFor the current object, this is selected within the prefab.
NameThe name of the SubObject.
ClassThe main of the SubObject (the main class type - for example, entity, brush, ambient volume, light).
TypeThe type of the SubObject (the sub type - for example, destroyable object, constraint, AI grunt).
Update PrefabObsolete (this is now done automatically) - Manually updates the selected prefab with any current edits.
Reload PrefabObsolete - Reloads the current prefab from the last saved version in the Prefab Library.
Pick and AttachAllows you to add a new object to the selected prefab, by clicking on it.
Remove ObjectAllows you to remove an object from the selected prefab; select the object from the Objects List, and then click the Remove Object button.
Extract ObjectExtracts a clone of a single object from the prefab, without altering or removing anything from the prefab object itself.
Extract AllExtracts all the objects from the prefab, without altering the Prefab Library.
OpenOpens the prefab group, allowing you to edit and manipulate objects within it.
CloseCloses the prefab so that internal objects cannot be individually edited.
Open AllOpen all instances of this prefab inside the level.
Close AllClose all instances of this prefab inside the level.