🤔

Coroutines: Halting#

Coroutines must be started properly to run to completion.
Starting a coroutine like a normal method call will halt silently.

Resolution#

Properly start the coroutine with a call to StartCoroutine. You are capable of passing arguments to the coroutine using this method.

void Foo()
{
StartCoroutine(Example());
}

IEnumerator Example()
{
yield return new WaitForSeconds(1);
Debug.Log("Complete!");
}

The coroutine still stops before completion.