- Home /
Reset a scene but save checkpoints.
I'v searched around about resetting a scene and
Application.LoadLevel(Application.loadedLevel);
seems to be the most popular solutions which works great. But in my scene I have checkpoints (triggers) that moves the spawn point. On level load the spawn point is moved back to it's original position.
I did try add
DontDestroyOnLoad (gameObject);
in the checkpoint script but no luck as this only creates another spawn point at start.
Anyone got a solution to this?
This can be a complex problem. DontDestroyOnLoad can get messy if you are not surgically precise with it.
Can you post your checkpoint script and describe the GameObject that you would attach it to.
Answer by guitarxe · Dec 13, 2013 at 04:38 PM
You could try moving your checkpoints to be static
variables, which do not get destroyed on scene reload.
Otherwise, create your own solution for reloading a level rather than doing Application.LoadLevel
Answer by GraviterX · Dec 26, 2013 at 04:51 AM
You could try making your checkpoint a trigger which sends you to another scene with the same layout
Your answer
![](https://koobas.hobune.stream/wayback/20220613124100im_/https://answers.unity.com/themes/thub/images/avi.jpg)