Prefab Setup
Game Creator 2 normally cannot save objects created during play. Persistent Instances registers them so their memories, Local Variables, and existence can be restored.
Configure a Prefab
- Open the prefab you want to persist.
- Add a Remember component to the prefab's parent GameObject.
- Add a Memory Instance memory inside Remember.
The parent Remember component controls the data saved for the instance.
Any Local Variables on the same parent GameObject are saved automatically. When the object is restored, Persistent Instances recreates it, restores its Remember memories, and restores its Local Variables.
Instantiate the Prefab
Use any normal Game Creator workflow, such as:
- Instantiate GameObject
- Dropping Items
- A custom script
Persistent Instances registers the object when it appears. No new instruction is required.
Re-parenting
When an instance has a parent at save time, Persistent Instances tries to restore the same relationship. For the most reliable result, give the parent GameObject its own Remember component too.
Recommended setup:
- The instantiated prefab has Remember and a Memory Instance.
- Its parent GameObject also has Remember.
Re-parenting can work without Remember on the parent, but it may be less reliable.
Inspect Registered Instances
The Instance Catalogue shows the prefabs currently tracked by Persistent Instances:
Assets/Plugins/Fullscreen/PersistentInstances/Resources/InstanceCatalogue.assetSelect InstanceCatalogue.asset to inspect the registered instances. If a prefab is missing, run:
Game Creator > Persistent Instances > Scan for PrefabsYou can also open the prefab, check that it has a Memory Instance, and save the prefab again.