Saving Instantiated Objects
Last updated
Last updated
When weapons are dropped or loot is collected from a loot box, the objects are automatically instantiated and saved using the Save & Load add-ons. However, there may be times when you want to manually instantiate an object in your scene and ensure it’s saved, so that it appears the next time the game is loaded. Fortunately, the Save & Load Add-On makes this process simple and straightforward.
Ensure your object to instantiate has a script that inherits from Identifiable, so the GameDataManager can recognize it.
Now, navigate to the Main Menu & locate DataPersistenceManager. This objects contains the GameDataManager component, where the Type To Prefab Mappings are stored. Create a new entry, select your CustomClassSaveData, and attach the Prefab to instantiate to it.
Check this guide for more related information.