- Home /
Loading a level while pausing the current one?
Hi everyone,
So I have a MainScene where I want to interact with an object and load a CarScene and that works, but I am trying to make it so that when you load the CarScene and finish playing it then load the MainScene again but not all from the beginning, instead I want it to load like just before I interacted with the object that took me to the CarScene. In other words I want to pause the MainScene when I load the CarScene so I can return to it after I am done with the CarScene Is this possible? I have tried with Application.LoadLevelAdditive but it just transports my first scene into the next one.
Thanks for the help
Attached to some GameObject you could save the state variables that define "just before I interacted with the object" (whatever those may be) and use the DontDestroyOnLoad function so, upon returning to the $$anonymous$$ainScene you'll "resume"
Put all your main scene objects under a root object $$anonymous$$ain and the car scene objects under Play. From $$anonymous$$ain you load the car scene additively and disable $$anonymous$$ain. To return to $$anonymous$$ain from state game play you enable the $$anonymous$$ain object again and destroy the Car object.
You can use free WhyDoIDoIt' solution for saving/loading your scene. This solution
Your answer
Follow this Question
Related Questions
What is the standard solution for preserving level data? 0 Answers
does LoadLevelAdditive() call MonoBehaviour.OnLevelWasLoaded ? 2 Answers
Spawn menu on Level Load 3 Answers
How do I change scenes from triggers in UNity 1 Answer
Load-level in Space 2 Answers