- Home /
My Level Take To much Time to Restart (c#)
Hello! My game is a 2D Platformer. When my player dies I restart the level using "Application.LoadedLevel" To load the same level. Sometimes it doesn't take more than 2 seconds to restart but sometimes it takes from 4 to 6 seconds to load the same level. I don't like that. I want to restart playing a second after I die (Theres NO gameover menu).
I searched for a way to load the level while I play with "Application.LoadLevelAsync" But I don't really know how to use it.
So if I use this code: using UnityEngine; using System.Collections;
public class ExampleClass : MonoBehaviour {
IEnumerator Start() {
AsyncOperation async = Application.LoadLevelAsync("MyBigLevel");
yield return async;
Debug.Log("Loading complete");
}
}
It will Load "MyBigLevel" in the background? then How do I Start it if I die? "Application.LoadLevel??".
And If there's another way of reducing the time Reloading how is it?.
THANKS! :D
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
Renderer on object disabled after level reload 1 Answer
c# check for destroyed objects to load next scene 1 Answer
Level Not Loading After Screen Fade 1 Answer