Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

New added StopCoroutine(Coroutine coroutine) override function causes errors.

Discussion in 'Editor & General Support' started by xVergilx, Dec 25, 2014.

  1. xVergilx

    xVergilx

    Joined:
    Dec 22, 2014
    Posts:
    3,296
    When StopCoroutine(Coroutine coroutine) used on coroutine that has been yielded by WaitForSeconds(delay), coroutine produces "Coroutine continue failure" in console when it tries to resume. Is this a bug, or intended feature? (C# language, if it matters)
     
  2. cesarpo

    cesarpo

    Joined:
    Jun 8, 2013
    Posts:
    97
    I have this exact same question.

    Anyone?
     
  3. Cynicat

    Cynicat

    Joined:
    Jun 12, 2013
    Posts:
    290
    halp. that is all.
     
  4. GrumpyEtha

    GrumpyEtha

    Joined:
    Dec 10, 2014
    Posts:
    1
    Add me to the list. The error doesn't seem to have an impact on anything, but it would be nice to know why it does result in an error and how we can avoid this behavior...
     
    Last edited: Jan 8, 2015
  5. snaka

    snaka

    Joined:
    Apr 21, 2014
    Posts:
    1
    Same error too. X(
     
  6. wwsoft

    wwsoft

    Joined:
    Aug 24, 2014
    Posts:
    1
    Same error ++;
     
  7. Dmitry-Pyalov

    Dmitry-Pyalov

    Joined:
    Dec 13, 2011
    Posts:
    125
    The same error in 4.6.1p3
     
  8. Nition

    Nition

    Joined:
    Jul 4, 2012
    Posts:
    781
    Hi people, I've seen this too. Has anyone already submitted it as a bug report?
     
  9. DarkAbsent

    DarkAbsent

    Joined:
    Jan 17, 2015
    Posts:
    1
    The same error in 4.6.1f1
     
  10. xikky

    xikky

    Joined:
    Dec 11, 2012
    Posts:
    47
    Same error too
     
  11. SoyUnBonus

    SoyUnBonus

    Joined:
    Jan 19, 2015
    Posts:
    43
    Works if you store the IEnumerator instead of the Coroutine and use that to stop the function. But yes, with the Coroutine, that error appears...
     
  12. Aurore

    Aurore

    Director of Real-Time Learning

    Joined:
    Aug 1, 2012
    Posts:
    3,106
    Has anyone submitted a bug report?
     
  13. SinisterDex

    SinisterDex

    Joined:
    Jul 2, 2013
    Posts:
    3
    Same issue here.

    Stopping via Coroutine reference returns an error "Coroutine continue failure".
    Can also confirm that stopping via IEnumerator works though.
     
  14. BernieRoehl

    BernieRoehl

    Joined:
    Jun 24, 2010
    Posts:
    80
    Yup, same issue here.
     
  15. Aurore

    Aurore

    Director of Real-Time Learning

    Joined:
    Aug 1, 2012
    Posts:
    3,106
    Bug number would really help
     
  16. Perceive

    Perceive

    Joined:
    Aug 2, 2013
    Posts:
    10
    I reported the bug, with the bug number 665426.
     
  17. Aurore

    Aurore

    Director of Real-Time Learning

    Joined:
    Aug 1, 2012
    Posts:
    3,106
    Thanks! :)
     
  18. Graham-Dunnett

    Graham-Dunnett

    Administrator

    Joined:
    Jun 2, 2009
    Posts:
    4,287
    I just put this into the docs for 5.0. This does not cause the error the post describes. StopCoroutine is documented as taking an IEnumerator. Passing in a Coroutine seems to work but triggers the error.

    Code (csharp):
    1.  
    2. using UnityEngine;
    3. using System.Collections;
    4.  
    5. public class Example : MonoBehaviour {
    6.  
    7.     private IEnumerator coroutine;
    8.  
    9.     // Use this for initialization
    10.     void Start () {
    11.         print("Starting " + Time.time);
    12.           coroutine = WaitAndPrint(3.0f);
    13.           StartCoroutine(coroutine);
    14.         print("Done " + Time.time);
    15.     }
    16.  
    17.     public IEnumerator WaitAndPrint(float waitTime) {
    18.         while (true) {
    19.             yield return new WaitForSeconds(waitTime);
    20.             print("WaitAndPrint " + Time.time);
    21.         }
    22.     }
    23.    
    24.     void Update () {
    25.         if (Input.GetKeyDown("space")){
    26.             StopCoroutine(coroutine);
    27.             print("Stopped " + Time.time);
    28.         }
    29.     }
    30. }
     
    IgorAherne and yashpal like this.
  19. Perceive

    Perceive

    Joined:
    Aug 2, 2013
    Posts:
    10
    As of 4.6, a feature in the patch nodes (but not the Unity Docs) is that Unity takes a Coroutine for StopCoroutine. (This can be found here, under Improvements:
    This is the third method for using StopCoroutine, with the other two using an IEnumerator and string (yuck) as parameters.

    This thread is not about the StopCoroutine(IEnumerator routine) method, but the StopCoroutine(Coroutine routine) method. While it's true that they are fundamentally very similar, there is one difference: with the IEnumerator method, care has to be taken that the IEnumerator isn't used in multiple StartCoroutines, as a StopCoroutine(IEnumerator routine) call stops all Coroutines started with that IEnumerator. With the Coroutine method, this isn't possible, as the Coroutine instance is a return from the StartCoroutine call.

    Really, we're just wondering what's up with the error. Is it something that we can ignore? Thanks for the quick response!
     
  20. superpig

    superpig

    Drink more water! Unity Technologies

    Joined:
    Jan 16, 2011
    Posts:
    4,649
    I think I fixed this in 4.6.1p4. The warning is annoying, but ultimately harmless.
     
    draxov likes this.
  21. Perceive

    Perceive

    Joined:
    Aug 2, 2013
    Posts:
    10
    Great, thanks!
     
  22. BlackLotus

    BlackLotus

    Joined:
    Aug 18, 2011
    Posts:
    12
    Installed 4.6.2f1 today hoping to have this fixed, no dice. Happens on StopCoroutine(Coroutine) and not StopCoroutine(IEnumerator).

    Here's my method, it doesn't have WaitForSeconds, it's really simple:

    Code (csharp):
    1.  
    2. IEnumerator PulseGlow() {
    3.     while(true) {
    4.         float alpha = 1 - (Mathf.Abs(Mathf.Sin(Time.realtimeSinceStartup)) * 0.5f);
    5.         Color newcolor = cardGlow.color;
    6.         newcolor.a = alpha;
    7.         cardGlow.color = newcolor;
    8.         yield return null;
    9.     }
    10. }
    11.  
    I have a question about storing the IEnumerator though... Consider the method above and this:

    Code (csharp):
    1.  
    2. IEnumerator glowCoroutine = PulseGlow();
    3. StartCoroutine(glowCoroutine);
    4.  
    In this example won't PulseGlow() be called once until its first "yield" when I store it in the glowCoroutine variable?
    And then, when I StartCoroutine with the variable, will it start over or will it pick up from the 2nd iteration?
    Kinda confused here... =P
     
  23. superpig

    superpig

    Drink more water! Unity Technologies

    Joined:
    Jan 16, 2011
    Posts:
    4,649
    It was fixed in 4.6.1p4, but the fix got accidentally stepped on in 4.6.1p5. It should be back soon.
     
    GrumpyEtha likes this.
  24. GuillaumeZAHRA

    GuillaumeZAHRA

    Joined:
    Jan 5, 2013
    Posts:
    53
    Sorry to up this thread, but i'm having this bug too on 4.6.2f1, when i call StopCoroutine with my Coroutine in parameters.
    If it's harmless, it's fine, but i wanted to notice you this. Better to see no error message.
     
  25. superpig

    superpig

    Drink more water! Unity Technologies

    Joined:
    Jan 16, 2011
    Posts:
    4,649
     
  26. iNoMore

    iNoMore

    Joined:
    Oct 13, 2013
    Posts:
    64
    its back with Unity5
     
  27. DanjelRicci

    DanjelRicci

    Joined:
    Mar 8, 2010
    Posts:
    308
    Agree, I'm just noticing this error popping up with Unity 5.0.0p3. :-/
     
  28. Rodolfo-Rubens

    Rodolfo-Rubens

    Joined:
    Nov 17, 2012
    Posts:
    1,197
    I'm getting this too... actually it happened only once, and seems like it's harmless.
     
  29. iNoMore

    iNoMore

    Joined:
    Oct 13, 2013
    Posts:
    64
    can someone reopen the bug? I cant find where
     
  30. Intentor

    Intentor

    Joined:
    Jul 24, 2013
    Posts:
    94
    It's also happening in a project I'm working on (Unity 5.0.1f1). On the project, StopCoroutine(Coroutine routine) is being called when a WaitForSeconds() yield is still waiting to be called.

    From my tests, the "Coroutine continue failure" seems to occur when Unity tries to call the stopped coroutine. It's indeed harmless, but annoying when on Editor because it pauses the game.
     
  31. Hullabu

    Hullabu

    Joined:
    Oct 23, 2014
    Posts:
    18
    Unity 5.0.2f1
    I got the same error when stopped the coroutine with "WWW www = new WWW(url)"
     
    Tehelee and chulini like this.
  32. ForceMagic

    ForceMagic

    Joined:
    Feb 27, 2015
    Posts:
    38
    Last edited: Aug 5, 2015
  33. Graham-Dunnett

    Graham-Dunnett

    Administrator

    Joined:
    Jun 2, 2009
    Posts:
    4,287
    What's the bug number? (Only want the 6 digits.)
     
  34. ForceMagic

    ForceMagic

    Joined:
    Feb 27, 2015
    Posts:
    38
    717779 I hope I gave enough info, since it's a Regression bug, I did not include a sample project.
     
  35. arklay_corp

    arklay_corp

    Joined:
    Apr 23, 2014
    Posts:
    242
    Any news? is there a bug report? I cant find it using that number
     
  36. ForceMagic

    ForceMagic

    Joined:
    Feb 27, 2015
    Posts:
    38
    The bug is still open and no action has been made on it. 717779 is the FogBugz number, the bug is public so not sure why you can't find it. I reported this bug in Unity 5.1.1p3,

    I havent seen it back on 5.2.1f1 though. Are you still having the issue? What is your current Unity3D version?
     
  37. arklay_corp

    arklay_corp

    Joined:
    Apr 23, 2014
    Posts:
    242
    Yeah, I'm still having it in 5.2.2
     
    Shushustorm likes this.
  38. TheValar

    TheValar

    Joined:
    Nov 12, 2012
    Posts:
    760
    FYI Still present in 5.3
     
    Shushustorm likes this.
  39. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,226
    Can someone create a bug report with an example project, 717779 is still waiting on QA to verify because it has a low rating. Providing an example project = higher bug priority
    Read more about this here.
     
  40. TheValar

    TheValar

    Joined:
    Nov 12, 2012
    Posts:
    760
    It looks like it's already in the issue tracker here but I'll happily create a new bug report if necessary

    Edit: Went to make an example project and oddly I can't reproduce it. Maybe the issue doesn't still exist after all and I'm just doing something else wrong.
     
    Last edited: Dec 15, 2015
  41. Phoera

    Phoera

    Joined:
    Mar 10, 2015
    Posts:
    9

    Are these guys the ones you are talking about here?
     
    JohnTube likes this.
  42. antx

    antx

    Joined:
    Feb 16, 2012
    Posts:
    28
    No,

    That's the bugger. It doen't say anything more.

    I just tried to make an example for reproduction but it somehow works there.

    In my actual project I get this error all the time. There I'm canceling a coroutine that is downloading images via WWW.
    The coroutine is definitly stopped but this error shows up anyway and annoys my perfectionist ego. :oops:

    Oh and btw: I'm stopping with IEnumerator and get this error!
     
  43. Grinchi

    Grinchi

    Joined:
    Apr 19, 2014
    Posts:
    130
    Bump ! Same error in 5.3.3f1 need Fix guys !
     
  44. hjalle

    hjalle

    Joined:
    Mar 15, 2016
    Posts:
    4
    Same problem here, both with StopCoroutine(Coroutine) and StopCoroutine(IEnumerator)

    This also seems to have started making iOS-builds crashing! So it's not a 'warning as error' anymore.
     
  45. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,226
    Can someone create a bug report with an example project that shows the issue please.
     
  46. hjalle

    hjalle

    Joined:
    Mar 15, 2016
    Posts:
    4
    @karl.jones, this seems to be 100% reproduceable. Just try to stop a coroutine with either of the two methods and you should get the 'error as a warning' message. I'm using 5.3.1p2
     
  47. hjalle

    hjalle

    Joined:
    Mar 15, 2016
    Posts:
    4
    @karl.jones I've now submitted a bug-report with a sample project to reproduce the issue.

    #780200

    To clarify, it was reproduceable while waiting for WWW-response, but not when waiting for a WaitForSeconds(float).

    Thanks
     
  48. Tastman

    Tastman

    Joined:
    Mar 12, 2015
    Posts:
    7
    So this error should be safe to ignore until it is patched, right?

    5.3.4f1 still in there. I'm getting the error when stopping with StopCouroutine(routine) during a for-loop yielding WaitForSeconds.
     
  49. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,226
    Hard to safe if its safe to ignore this until its been investigated. It could be a legitimate error message. You can track the bug here http://issuetracker.unity3d.com/iss...ontinue-failure-when-stopping-a-www-coroutine
    If I do hear if its safe to ignore ill let you know
     
  50. Disastercake

    Disastercake

    Joined:
    Apr 7, 2012
    Posts:
    317
    I'm having this bug as well. It doesn't appear to be harmless, as I run a start and stop coroutine calls on mouse enter and exit events in the GUI and the methods don't seem to be triggering if the mouse enters and exits swiftly as the error is posted.
     
    Last edited: Apr 13, 2016