I am using OnTriggerEnter to load next level as player enters an area, what i am having trouble with is displaying text on screen to alert player that next level is loading…Can you help??
function OnTriggerEnter (col : Collider) {
print("Loading Next Level");
yield WaitForSeconds (5);
Application.LoadLevel (3);
}
You could just make a level load that’s just a loading screen, with 3dText centered on the camera while the actual level loads.
//At the top of the Screen:
GameObject → Create New → 3dText(Gui Text might also work)
and then have THAT loading screen load your next level!
Then you could throw in a cool splashscreen while the next level loads, although to be honest, if I ever had to load a unity level for more than a few seconds it’s usually too choppy to even play
From Unity 3d forum - create a small game object, with a script attached, that sets DontDestroyOnLoad in its awake function. This game object displays your text for “please wait, loading…” and then after a few seconds, and definitely after the level has loaded, the game object destroys itself.
Code:
function OnTriggerEnter(col : Collider)
{
GameObject.Instantiate(yourLoadingGameObject, Vector3.zero, Quaternion.identity);
Application.LoadLevel(3);
}
Then stick this script on whatever object you want to instantiate just before you load your level.
Code: