- Home /
Scene looks later 7 seconds.
Hi! This line is works later 7 seconds all the time. When I selected restart button, scene looks later 7 seconds.
if (GUI.Button(
new Rect(
Screen.width/4+10,
Screen.height/4+2*Screen.height/10+10,
Screen.width/2-20,
Screen.height/10),
"RESTART")) {
Application.LoadLevel(Application.loadedLevel); //works 7 sec later
}
How to solve this problem? Thankss.
Please post the full script and format your code with the 101010 button. Thanks.
Formatted the code to be readable. The 7 second... looks later? Whatever is happening after 7 seconds, it's not due to any of the code you've posted here - unless it's a 7 second load time for the scene.
Answer by HarshadK · Dec 15, 2014 at 01:20 PM
Few possible reasons off the top of my head:
Your scene takes 7 seconds to load.
You have a coroutine somewhere that prevents loading next scene for 7 seconds.
Answer by Jessespike · Dec 18, 2014 at 06:56 PM
Instead of reloading the current scene with Application.LoadLevel(), write you're own "Reset()" function. Probably won't find a faster way than this.
Your answer
Follow this Question
Related Questions
How to make loading screen 1 Answer
GUI Bloodsplat Screen 1 Answer
How would I keep my player from going past the background? 5 Answers
changing the sprite scale with screen resolution 1 Answer
Orientation Problem 1 Answer