- Home /
Question by
AmazingDeveloper2 · Feb 09, 2016 at 07:49 PM ·
c#unity 5coroutine
Delay between coroutines
I have a lot of coroutines and I need to launch them one after another. But I should start next coroutine after the previous finished... and my code launch all of them at the same time.
void Start()
{
StartCoroutine("It");
StartCoroutine("Is");
StartCoroutine("What");
StartCoroutine("It");
StartCoroutine("Is");
}
IEnumerator It()
{
ChangeMaterial(wordIt, materialWhite);
yield return new WaitForSeconds(1.0f);
ReturnMaterial(wordIt);
}
Comment
Best Answer
Answer by Jessespike · Feb 09, 2016 at 08:10 PM
Put the StartCoroutines in a coroutine
IEnumerator Start()
{
yield return StartCoroutine("It");
yield return StartCoroutine("Is");
yield return StartCoroutine("What");
yield return StartCoroutine("It");
yield return StartCoroutine("Is");
}
Your answer
Follow this Question
Related Questions
How to delay gameobject from falling by time? 1 Answer
Multiple Cars not working 1 Answer
Lerp in Coroutine (Crazy Behavior) 2 Answers
Distribute terrain in zones 3 Answers
How do I get into the data returned from a UnityWebRequest ? 2 Answers