- Home /
Wait n-seconds before loading level
I've problem with waiting, even in coding. I need my game to wait like 5 seconds (public int would be awesome) before Application.LoadLevel(0); so player can cry for few secs before starting again. So far the code looks like
if(Data.ReturnPlayerHealth() <= 0)
{
Awake();
Data.ChangePlayerHealth(100);
Destroy(this.gameObject);
}
IEnumerator Awake()
{
yield return new WaitForSeconds(5);
Application.LoadLevel(0);
}
Doesn't work and I've no idea where it went wrong.
Comment
Your answer
Follow this Question
Related Questions
timed out load level 2 Answers
Load Level delay on collision C# 1 Answer
Better way for a timer to load a level? 1 Answer
Scene not loading properly everytime 3 Answers
Waiting then Executing 4 Answers