Kelvin
0
Q:

waitforseconds unity

void start()
StartCoroutine(Text());

IEnumerator Text()  //  <-  its a standalone method
{
	Debug.Log("Hello")
    yield return new WaitForSeconds(3)
    Debug.Log("ByeBye")
}
6
		public void GameOver()
		{
			//Set levelText to display number of levels passed and game over message
			levelText.text = "After " + level + " months, you starved.";

			new WaitForSeconds(6);

			Application.Quit();


		}
7
using System.Collections;

private void Start()
{
	StartCoroutine(Wait());
}

IEnumerator Wait()
{
	//To wait, type this:
  
  	//Stuff before waiting
	yield return new WaitForSeconds(/*number of seconds*/);
  	//Stuff after waiting.
}
3

New to Communities?

Join the community