Issue when reloading scene

Discussion and help for Easy Save 3
Post Reply
lvladimirov
Posts: 8
Joined: Fri May 06, 2022 5:29 pm

Issue when reloading scene

Post by lvladimirov »

Hello there,
Let me start off by saying the asset is pretty great and saves a ton of time. Now the issue I currently have is with reloading scenes and then loading from the save. Maybe that is not entirely true as I guess the exact problem is the order of execution .LoadScene will load in the next frame, so even tho im loading the save file after I call LoadScene, the data from the file is read and applied and then the scene gets reloaded the next frame and overwrites everything, making it look like the load form the file did not work. That is my current theory, but i couldnt manage to solve it by using an Invoke("loadFromES3", 1.0f); after the .LoadScene, so I could be wrong. Any ideas of what the issue might be and how would be the proper way to reset the scene and load values from the es3 file?
Thanks!
User avatar
Joel
Moodkie Staff
Posts: 4826
Joined: Wed Nov 07, 2012 10:32 pm

Re: Issue when reloading scene

Post by Joel »

Hi there, and thanks for getting in contact.

You should load the data in the scene that you’re loading (for example in an Awake method in that scene), rather than in the scene that you’re calling LoadScene from.

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
lvladimirov
Posts: 8
Joined: Fri May 06, 2022 5:29 pm

Re: Issue when reloading scene

Post by lvladimirov »

Thanks for the answer, It makes sense and I tried it like that initially (only not in awake, but in start, as loading is triggered by an event, to which the listeners subscribe on enable). Anyway, after more testing I think that the save system itself seems to work fine ot its own, I only have issues if I use SceneManager.LoadScene(scene.name); as well, however it seems it no longer belongs in this forum as its not a problem with ES3 :D
Thanks for the help!
Post Reply