Here is my coroutine :
IEnumerator SyncLevelCoroutine(LevelData a_level)
Network.isMessageQueueRunning = false;
while(m_nStatus == EStatus.eSynchronizing)
yield return new WaitForSeconds(0.1f);
Network.isMessageQueueRunning = true;
and here is the call of the coroutine :
The coroutine is stopped in the WaitForSeconds statement. I have tried to put a Debug Log before this line, but the log is shown only once. Any log after the while loop is not shown.
If I replace "yield return new WaitForSeconds(0.1f)" by "yield return null", it works. Any idea why WaitForSeconds lasts an eternity?
this guy had a similar problem. http://answers.unity3d.com/questions/60725/waitforseconds-problem-with-unity-pro.html
Check your timescale in your project settings. Maybe thats the issue.
well thank you, that was that... I m feeling so dumb right now...
Answer by Tourist
Mar 14, 2013 at 09:24 AM
Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.
The best place to ask and answer questions about development with Unity.
To help users post good questions and use the site effectively we have posted a user guide.
If you are a new user, check out our FAQ for more information.
If you are a moderator, see our Moderator Guidelines page.
We are making improvements to UA, see the list of changes.
For troubleshooting common problems with Unity 5.x Editor (including Win 10).
Answers and Comments
11 People are following this question.
Choking on WaitForSeconds coroutine (solved)
how to detect how long a bool has been true
Load Level when dead for 1 second
SpeedBoost won't reset : Problem with either WaitForSeconds or Coroutine (Solved)
yield works, but yield WaitForSeconds does not?