Set up prefabs that can be saved between scenes and in save games.
Prefab savers are set up in System > Prefab Savers.
Using Prefab Savers #
Prefab savers are used to store information of spawned prefab instances. Saved prefab instances will be respawned and load the stored data when the scene is loaded.
Adding Prefabs Instances #
Prefab instances need to be added to the prefab savers in order to save them.
This is done in the Spawn Prefab node in schematics, by enabling the Add Prefab Saver setting. This setting is disabled by default, not using prefab savers.
Prefab instances that are added to a prefab saver will save their content when they are destroyed, i.e. also when changing scenes.
Removing Prefab Instances #
Destroying the prefab instance will save it’s content, respawning it when the player reloads the scene.
To prevent this, the Destroy Prefab and Destroy Object nodes in schematics have the Remove Prefab Saver setting. This setting is enabled by default, removing the destroyed object from prefab savers.
You can also remove an instance without destroying it using the Remove From Prefab Saver node. Beside removing a single instance, it can also remove all instances of a prefab saver, or all prefab savers in the scene.
The Clear Prefab Savers node can remove all prefab data from a scene or all scene.
Saving Content #
Prefab Savers can save the same content and are saved/loaded with scene changes and save games.
What is saved? #
The following content can can be saved:
- position
- rotation
- scale
- local variables
You can also save this information for all child objects of the saved object.
Additionally, any component attached to the object (and it’s child objects) implementing the IComponentSaveData interface will be saved as well.
When is it saved? #
An object’s data is saved when it is destroyed. This also includes when it’s destroyed by changing scenes.
If the data is also saved with save games, all (saving) objects of the current scene will store their data as well.
When is it loaded? #
The data is loaded when the scene is loaded.
Save Games #
To save prefab saver data with save games, you need to set up saving them in Menus > Save Game Settings. You can save the data from all scenes or only the current scene – and automatically remove data from a scene after a defined number of scene changes (without returning to the scene).

