- Home /
"Reset Level", Application.LoadLevel
Hello all,
I am attempting to reset the level when specific conditions are met.
The method Die() is called on conditions met which calls Application.LoadLevel. Application.LoadLevel expects an int scene index so I passed it Application.loadedLevel like so:
void Die(){
Application.LoadLevel(Application.loadedLevel);
}
The level does seem to be reset, but all objects (or object positions) seem to be created then instantly destroyed. If I instantiate a prefab on a timer, the object gets created but immediately destroyed.
Any assistance / documentation?
Answer by focus915 · Oct 16, 2014 at 05:15 AM
Figured it out. My "background" sprite was appearing in front of my "player" sprite. Assigned player to Order in Layer = 1 and background Order in Layer = 0.
Your answer
Follow this Question
Related Questions
reset the level? 5 Answers
Load a random scene from a list of strings. 2 Answers
How to Reset Scene after Level Completion 1 Answer
When loading the scene, I get missing references 5 Answers
help please: Level Changing Scipt 1 Answer