Wouldn´t it be nice, if a missing yield inside a coroutine would not crash unity?

Just a detail really to prevent user errors:

  • Currently when you forget to insert a “yield return…” inside a coroutine´s while() loop, unity crashes immediately.
  • Wouldn´t it be nice if it somehow failed more gracefully?

Would of saved me some crash recovery countless times.

Can you post an example of your loop. Not that I want to be the one to test it lol. I would like to see if I can spot any errors.

That would be great. If unity could detect that the editor stops responding for more than a minute it should pop up asking if you’d like to pause/stop the play window.

While I understand where you’re coming from, should you start inserting the yield after the first dozen or so crashes?

It’s better than it crashes and makes you know there’s a problem instead of just silently failing to do what you want. It’s a lot easier to track down that way.

How about you just write code properly :wink:

There are very few exceptions that unity will fall into a infinite feedback loop or overflow the stack, and you’ve clearly discovered the most obvious one. If your writing an enumerable function that does not return, you don’t understand how an enumerable function works.

Those darned computers - always doing exactly what you tell them to do…