Answer the question
In order to leave comments, you need to log in
How to save a scene in UNITY?
you must exit play mode to save the scene
unity
It is necessary to save the scene (level) when exiting the game / switching to the main menu (ie, when moving to another scene).
I searched for information about this on the Internet, found saving via PlayerPrefs or JSON, but as far as I understand, only individual variables can be saved there (for example, the amount of health, the volume of the background sound). And I have a large number of objects on the stage in the game and I don’t want to write my own save for each of them.
How can you save the entire scene so that when you return to a given level (scene) everything is the same as when you exited (save lives, stock of ammo, placement of objects (prefabs) on the scene)???
I would be very grateful, since it is necessary to implement saving, but there are no ideas (
Answer the question
In order to leave comments, you need to log in
No, it won't work like that. Saving the state of the game is precisely saving a certain data model that describes the changed world, and not design changes in the scene. You remember which objects moved, collapsed, etc. and that's what you keep. When loading a scene, arrange them according to the saved description.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question