How can i save and load the 3D scene in file.
Hello,I have been creating my own scene editor where i can create my scene with instantiate prefab, but now i need a way to save and load the scene to a file First I thought about creating a new prefab, but this is only available in Editor scripts, and I need to do that stuff in runtime. Can anyone help me to find a way to save and load my scene ? (all in runtime)
Thank you a lot!
Answer by WobblyBob · Jan 30, 2016 at 07:13 AM
Hello Manou, I have been looking for the same answer and after some researching found that one way to save the world is to use PlayerPrefs. This method involves saving the x, y and z coordinates of each object as an individual float in the PlayerPrefs. Then, On scene Awake, each object will go to the coordinates saved in the playerPrefs earlier. This method is extremely inefficient but I though I would share it anyway. This method of saving and loading can be useful for saving things like how much money the player has or perhaps their level. But for complete scene saves I would not recommend it.