- Home /
async loading scene
I have an async loading script loading a new scene. I have a save script that will populate the new scene. Everything is run by an ienumerator that waits until the scene is fully loaded until it activates.
My problem is is that my save file updates the new scene before it gets activated in the IEnumerator like:
UpdateGameFromSave(save);
if (!saveLoaded)
yield return new WaitForEndOfFrame();
else
async.allowSceneActivation = true;
UpdateGameFromSave() has a bool that checks true if save is loaded called saveLoaded which is part of the same class. Yet the async loads the game and shows it and then 2 or 3 seconds afterwards the UpdateGameFromSave() method places the player to the correct location. Before that you can clearly see that the player is at the starting location as if you were starting a new game. The saveloaded bool proves true after the scene is activated which should only happen before the scene is allowed to be activated. How would you guys solve this problem?
If you need more code or explanation, please tell me and i will supply them. I really need this problem solved. Mind you the bool saveLoaded starts out as false.
Your answer
Follow this Question
Related Questions
Load Scene from intermediary Scene 1 Answer
How do I assign serialized data, to my player script? 2 Answers
how to keep the script working after scene load? 1 Answer
Load Different Stages 1 Answer
Why won't my scene play? -1 Answers