- Home /
How to Save Objects that were added into the scene at runtime
So in most survival games, you can build and place walls, roofs and all that. Then you can save and close your game. And when you come back, your buildings are in the same place where you left them. How do I go about saving objects that were added in during runtime?
Answer by phil_me_up · Mar 13, 2016 at 06:30 PM
You'll need to write some system (or buy one from the asset store) that enables you to retrieve key data from your objects, such as position / health etc, and save them out in some format (XML, JSON etc).
I answered this very question, but phrased in a different way, a couple of days ago: http://answers.unity3d.com/questions/1153260/how-do-i-save-the-game-state-as-a-new-scene-while.html#answer-1153381
Answer by Cherno · Mar 14, 2016 at 09:53 PM
You can check out my free SerializeHelper save & load utility, aimed at teaching beginners the basics of saving and loading data, while also providing a framework.
SerializeHelper - Free save and load utility. (De)Serialize all objects in your scene.