- Home /
How do I get the scene to load in the background when on the loading screen?
Hi Guys I have a loading screen where in the scene i have an image sequence showing but i have to put a 10 second delay on loading the level so it show all of them because after the 10 seconds everything stops whilst the level loads. How do i get it so the level is loading in the background whilst the images are showing.
This is my loading screen code:
var seconds : float;
var levelToLoad : String;
function Start() {
yield new WaitForSeconds(seconds);
OpenLevel(levelToLoad);
}
function Update () {
if(Input.GetKeyUp(KeyCode.Return) ||
Input.GetKeyUp(KeyCode.KeypadEnter)){
OpenLevel(levelToLoad);
}
}
function OpenLevel(level : String){
Application.LoadLevel("DemoLevel");
}
Load the level with the loading screen as the first thing you see, set the 10 second timer, and when it ends, hide or destroy the image.
Answer by MickM · Feb 25, 2013 at 10:19 AM
If you have pro: http://docs.unity3d.com/Documentation/ScriptReference/Application.LoadLevelAsync.html
Otherwise you could try have the loading screen using DontDestroyOnLoad so it remains while the other scene is loading; then have a method in the demolevel (maybe on Awake?) to destroy the loading screen picture?
Answer by robounited · Apr 07, 2013 at 06:13 PM
ok i've had another go at this and i can use ASinc but it stops my animation, i want my animation to continue until the level is loaded and then change scenes. Any ideas please?????
incredibly snarky multiple-? comment.
this isn't an answer.
Your answer
Follow this Question
Related Questions
disable GUI when loading is done 5 Answers
C# Save/Load - Save entire class contents? 1 Answer
Saving & Loading the scene (or at least one array) via Javascript 1 Answer
Delay on button press 3 Answers
Audio loop after time 2 Answers