Complete the code to start a coroutine named MyCoroutine.
StartCoroutine([1]);To start a coroutine, you call StartCoroutine with the coroutine method including parentheses.
Complete the code to make the coroutine wait for 2 seconds.
yield return [1];
To pause a coroutine, you yield return a new WaitForSeconds object with the desired time.
Fix the error in the coroutine declaration to make it valid.
private [1] MyCoroutine() { yield return null; }
Coroutines must return IEnumerator to work properly in Unity.
Fill both blanks to create a coroutine that waits 3 seconds and then prints a message.
private IEnumerator WaitAndPrint() {
yield return [1];
Debug.[2]("Waited 3 seconds");
}The coroutine waits 3 seconds using new WaitForSeconds(3) and then logs a message with Debug.Log.
Fill all three blanks to create a coroutine that waits 1 second, then waits 2 seconds, and finally prints 'Done'.
private IEnumerator DoubleWait() {
yield return [1];
yield return [2];
Debug.[3]("Done");
}The coroutine waits 1 second, then 2 seconds, then prints 'Done' using Debug.Log.