Hi, so my game is sort of set in a little town, and every building you enter is a different scene. I successfully managed to make each building an Additive scene that loads when the player enters them using SceneManager.LoadScene(X, LoadSceneMode.Additive), and successfully manage to unload the scenes using SceneManager.UnloadSceneAsync. However, when the player re-enters a building they just left, the scene “resets” (as in, all enemies and scripted events respawn and reset). Is there a way to somehow save the information in the additive scene so that when the player “re-enters” the scene, everything they did in said scene remains the same?
Yes, it’s called implementing a data-persistence system, or generally known as a save system. You will want to record all relevant data, store it somewhere, and pull from it when entering the scene.
If you haven’t done a save system yet, there’s lots of tutorials out there to get you started.
This is very good to know. Do you recommend any tutorials in particular?
I would follow any decent tutorial, mostly to get to grips with what it takes to write and read data out to a file, which is the first thing you need to learn. Play around with the concepts in a standalone project until you get to grips with the concepts involved.
Other than that it’s just learning as you go. Figure out the data you need to save, and research ways to structure things so that you can achieve this. I wouldn’t be able to point to a specific tutorial, as this is the the kind of thing that varies greatly on a per project basis. But it should be front and center in your mind as many other systems need to be build with saving in mind, not as an after thought.