Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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 Fattie · Feb 25, 2013 at 07:25 AM · yieldcoroutines

"Coroutine couldn't be started..." warning - harmless?

You've probably had this situation: you have an object (perhaps a button for example)

You have some minor behaviour attached below it (say, a repetitive glow on the button)

As you enter the scene, you make the whole object inactive.

Now, this means you'll get the alert

"Coroutine couldn't be started because the the game object ''exampleGlow'' is inactive! UnityEngine.MonoBehaviour:StartCoroutine_Auto(IEnumerator)"

In fact ........... is this warning harmless?

I usually go through and fix these so you don't get the warning, but I've often shipped with a few of those. In fact is it harmless? (I've never seen any harm come, but someone may have more info.)

Cheers

Comment
Add comment
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

1 Reply

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by Tarlius · Feb 25, 2013 at 07:53 AM

Well, it depends what the coroutine it couldn't start does! If its a button glow you probably won't care, but if its something that tracks a game objective and fails to start... well, your game is broken.

I normally check whether the game object is active or not before I try starting a coroutine on an object that I expect might get turned off, because for some reason it errors for me, not warning... Might be a platform dependant thing?

Comment
Add comment · Show 3 · Share
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 Fattie · Feb 26, 2013 at 07:21 AM 0
Share

thanks, I need specific information whether that message thrown by Unity results in Unity stopping or not. I mean when running on a final device in a consumer's hands.

When you say it errors for you, what platform is that on man, what device?

thanks for that ..

avatar image Tarlius · Feb 26, 2013 at 07:41 AM 0
Share

I just ran a simple test with the following code, with iOS as build target in the editor:

 void Awake() {
         this.gameObject.active = false;
         StartCoroutine(testCoroutine());
         this.gameObject.active = true;
         Debug.LogWarning("Continued");
     }
     
     IEnumerator testCoroutine() {
         while(true) {
             Debug.Log("Running");
             yield return null;
         }
     }

Continued was printed on the log, Running was not. I always thought it was an exception, but its only an error log. The rest of the routine will run as normal, but the point that the coroutine won't fire stands. So whether the error is "harmless" or not depends what logic you're failing to launch.

avatar image Fattie · Mar 01, 2013 at 03:53 PM 0
Share

O$$anonymous$$ I completely understand that in terms of my own code, the code must work :-) I was asking about whether it throws some sort of problem from Unity's pov, when in the consumer's hands.

I feel you have in fact nicely proved that there is no problem, it's only a dumb error $$anonymous$$ESSAG$$anonymous$$

I really appreciate this and this is a great answer. Thanks.

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

11 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Waiting for a coroutine to complete before getting a return value 1 Answer

Delay Jump 1 Answer

Coroutine not running 1 Answer

Yield return inside a loop slowdown problem 2 Answers

WaitUntil doesn't work and the coroutine starts anyways 1 Answer


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