- Home /
A simple Splash and Loading screen script please!?
I have been looking around for a very long time and i have found multiple Loading screen scripts and Splash screen scripts but they NEVER WORK!
I just want a splash script so when the player loads up the game, it'll go to a splash screen of a custom texture and go to the main menu.
And i'd like the loading screen between scenes, something like "loading.. please wait".
Can anyone please help me!!
Answer by kilian277 · Jun 19, 2013 at 01:45 PM
The method i give you works in unity free for pro check below.
For the splashscreen you can add a new scene and add a script that gets a texture as variable , and a int or string to load the main menu scene.
In the script you can change the alpha of the texture (first set it to 0 in the inspector) so in the Start method add some lines that raise the alpha value of the texture together with Time.deltatime to raise it every second (you can also add a value that multiplies with the Time.deltatime so it's a bit quicker)
Then you just wait for a certain amount of time and do the same as the fade in but then in reverse.
After that load the main menu scene.
For the loading screen you can also make a seperate scene and then add a guitexture to it like "Loading , please wait..." or something and add a script to the main camera and in thestart method add the code for the new scene to load.
You can also to this is in the same scene and then load the level (make a scipt for that).
If you have unity pro you can use
Application.LoadLevelAsync(id);
This will load the level at the same time while your current scene is still running.
From this information you should be able the build a script upon.
Hope it helps !
Application.LoadLevelAsync(id);
for that what exactly do i have to do for it? my understanding is i make a loading screen gui, chuck it on main camera, then make a script and place it onto the main camera? is that it?
loadlevelasync loads the level simultaneously while the current level is not interrupted but to use that you will need unity pro.
For a loading screen ingame that will suffice. If you want to make a loading screen between scenes you can create a seperate "loadingscene" scene and do everything from above.
Your answer
Follow this Question
Related Questions
Script wont read array 2 Answers
Take screenshot script doesn't work 1 Answer
Loading Screen - FLASH export 2 Answers
"You are not allowed to remove the Unity splash screen from your game", but I didn't 0 Answers
Screen position orientation flipping 1 Answer