- Home /
 
Nested coroutine handling
At what point did Unity start to support nested coroutines? The following code works in Unity 5.4.2, but it didn't used to not a long time ago:
     IEnumerator Start()
     {
         yield return Inner(1);
         yield return Inner(2);
     }
 
     private IEnumerator Inner(int id)
     {
         Debug.LogFormat(this, "Inner {0} begin", id);
         yield return 1;
         yield return 2;
         Debug.LogFormat(this, "Inner {0} end", id);
     }
 
               If I recall correctly last time I checked, which was less than a year ago, one would have to do yield return StartCoroutine(Inner(...)); instead. See http://answers.unity3d.com/questions/14081/nested-coroutines.html
In what version did that change? Was it mentioned in the release notes?
I've just found this myself, and I too haven't found anything in the release notes. Very strange. I've just reached out to a Unity employee I know on twitter.
Your answer
 
             Follow this Question
Related Questions
Make a function that can return string or IEnumerator 2 Answers
Coroutine Not Working 2 Answers
IEnumerators saving passed value into two different variables. 1 Answer
WaitUntil doesn't work and the coroutine starts anyways 1 Answer
Brain exploding ... Problem with an internal Coroutine manager 3 Answers