Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 11 Next capture
2021 2022 2023
1 capture
11 Jun 22 - 11 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by paskal007r · Jul 21, 2015 at 11:04 AM · c#unity 5bugcoroutines

Coroutines white death causes?

In my project I have a wide usage of coroutines and playmaker FSMs. At some point in the execution of a scene something goes really wrong: suddenly all coroutines stop without any error, after this occurs some FSMs get disabled after a trigger event. The only way I noticed the coroutines are not executing anymore is by their lack of effects and through the Monodevelop code debugger, I placed breakpoints in said coroutines and it didn't stop there.

I wasn't able to find any code responsible for this, also because I don't know what to look for. As far as I know, to kill all the coroutines in a scene it would take a .StopAllCoroutines on every script in the scene, no such thing in my code.

Also, there are no in-game events that match the particular moment in which the wild bug appears.

I've also tried my project from another pc. The bug there just doesn't show up. I then tried to re-install unity, have a clean clone of the project from repository and it still happened. My next attempt will be to use a virtual machine to install unity and test for that bug in the new environment... please help!

Here is the code from one of the coroutines:

     protected virtual void OnEnable () {
         initialize();
         StartCoroutine (slowUpdate());
     }
 
     public virtual void initialize(){
         if (debug)
             Debug.Log ("baseInvaderMovement initialize:");
     }
     
     protected virtual IEnumerator slowUpdate(){
         while(true)
         {
             if (debug)
                 Debug.Log ("BaseInvaderMovement slowUpdate Interval (speederInv):"+slowFrameInterval);
             
             yield return new WaitForSeconds(slowFrameInterval);
             slowUpdateCycle();
         }
     }
 
     protected virtual void slowUpdateCycle(){
         if (debug)
             Debug.Log ("slowUpdate Interval (baseInv):"+slowFrameInterval);
         //do stuff on gameobject
     }



If this script is disabled and then enabled it will execute a single time its slowupdatecycle and then die without a word again. Precisely it dies on the yield return new WaitForSeconds instruction.

Comment
Add comment · Show 2
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image meat5000 ♦ · Jul 21, 2015 at 11:04 AM 0
Share

http://forum.unity3d.com/threads/fixed-coroutine-issue-coroutine-stopped-for-no-reason.329317/

I cant find much on the issue.

avatar image paskal007r · Jul 21, 2015 at 12:07 PM 0
Share

Thanks meat5000 for the reply, I checked the project for Invoke methods instances, only found one in playmaker scripts. Decided to log its input, only gets 0 as input, correctly logged. But maybe some other things could be producing the same effect... I wish I knew what...

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

3 People are following this question.

avatar image avatar image avatar image

Related Questions

I keep getting an error when try to change the tag of a gameObject 1 Answer

ground detection fails 0 Answers

In-App-Purchases not working (Android) 1 Answer

Multiple Cars not working 1 Answer

Im trying to make the enemy flash red when the bullet hits them 3 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges