U
U
user010gt2021-06-19 12:29:05
Unity
user010gt, 2021-06-19 12:29:05

How to save a scene in UNITY?

you must exit play mode to save the scene 60cdb8ce4ffe2161409087.png
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

1 answer(s)
F
freeExec, 2021-06-19
@user010gt

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 question

Ask a Question

731 491 924 answers to any question