The flag isDone does go to true and the thumbnail is loaded. Suggestions? I’m I piling up unfinished coroutines as I load each thumbnail? Is there a way for me to watch coroutines?
Where and how do you execute your coroutine and what other “states” are changed? Time.timeScale == 0? Do you test in the Editor or in a build? What’s your build target? Webplayer, Standalone, mobile?
Are you sure that the Gameobject and the script instance where this coroutine runs on is not destroyed?
I also have strange behaviors lately with yield SOMETIMES never returning.
I added a debug log after the yield like that:
yield return new WaitForEndOfFrame();
Debug.Log (“returned from yield…”);
The coroutine happen to be executed for some amount of time and then just suddenly stops…
The script instance that start the coroutine as well as the object that it is attached to are pretty basic and are not destroyed,
no object is destroyed yet in the project, there is not even a stop-coroutine call of any kind.
Oddly enough,
I already released an entire unity made game with a relatively intensive use of coroutine without ever running into any trouble.
The most annoying part is that it doesn’t always happen.
My code is very simple and basic, i m at a loss after an hour debugging
Edit: After restarting Unity and Monodevelop I just could’t reproduce the bug at all… Well I happy with that.
I guess I can’t leave a comment, rep too low probably. Anyway, I was reading this thread because I had the same issue. I had the debugger running while reading this, and after about 5 minutes I clicked back to Unity and it finally hit my breakpoint. So 2 possible checks for future readers:
Make sure your game isn’t paused (i.e.-you clicked away form the Unity editor, over to MonoDevelop for debugging).
Keep in mind some HTTP requests can take A LONG TIME to complete, like even 2 minutes or more. In my case I was testing on Windows and using my machine name for the URL, like http://my-pc-name/ because I was testing a custom game server I’m also writing. I then moved over to Mac to test, and I guess Mac sucks so it was “hanging” for like 5 minutes on the DNS lookup for “my-pc-name”.
We are having the exact same problem on Webplayer.
So far, it only happens on Firefox 40.x, on Mac and Win.
This is perfectly reproducible on our projects, were we send many events via WWW.
It happens very often on the following combinations.
Even PCs where the problem didn’t occur, the auto-update to Firefox 40 made this happen.
Not an expert on yields - but programmer’s logic tells me that maybe the ‘return’ is the problem. Return generally ends the execution of a function. If you take a look at
there’s no return. Maybe try it without. Hope that helps.