Hi, i have a loading scene with every object in the scene parented to ONE empty game object and a script attached to it.
function Update(){
Application.LoadLevelAdditive("Game2");
Destroy(this.gameObject);
}
So basically this script loads the scene "Game2" but it changes scenes so fast that you cant even see the loading screen...so i want a delay before the script changes scene, is there a way to do it? ( i tried using waitforseconds but that didnt work cause it will just stay at the loading scene)
A few things: if you’re going to use yield WaitForSeconds, you need to use it an IEnumerator block that is called by StartCoroutine. Also, since this is only going to happen once, you’d probably want to put it in Start instead of your Update function. Try this:
private IEnumerator LoadNextScene ()
{
yield return new WaitForSeconds (5.0f); // Change this float to the number of seconds to delay for.
Application.LoadLevelAdditive("Game2");
}
void Start ()
{
StartCoroutine (LoadNextScene ());
}