• 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 Henrique Vilela · Apr 26, 2011 at 01:25 AM · coroutineyieldwaitforsecondsprostartcoroutine

WaitForSeconds problem with Unity Pro

... StartCoroutine(SomeMethod()); Debug.Log("Works fine"); ...

IEnumerator SomeMethod() { Debug.Log("Works fine"); yield return new WaitForSeconds(1);
Debug.Log("Never called"); }

T$$anonymous$$s code above used to work till I upgrade Unity to pro, so I believe the code it-self is ok.

But what could I be doing wrong? Could be a new player setting that comes with pro?

If I change WaitForSeconds for WaitForEndOfFrame or WaitForFixedUpdate, it works. Only WaitForSeconds stuck it.

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 Kourosh · Apr 26, 2011 at 01:32 AM 0
Share
avatar image Henrique Vilela · May 03, 2011 at 08:48 PM 0
Share

3 Replies

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

Answer by Ashkan_gc · Apr 26, 2011 at 01:48 AM

it's really strange and i t$$anonymous$$nk there is a problem in another side, for example in your project settings/time or ... somet$$anonymous$$ng changed (timescale or ...) and that could be the source of your problem cause the code is totally ok!

Comment
Add comment · Show 1 · 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 Henrique Vilela · May 03, 2011 at 08:47 PM 0
Share
avatar image
1

Answer by cmasterenko · Apr 26, 2011 at 02:35 AM

Have you tried making a new test project with primitives and just that code to see how it functions, I had some script just randomly stop working for me before, but it worked when I rebuilt my project from scratch.

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

Answer by Silverfell 1 · Apr 26, 2011 at 02:18 AM

Random thoughts:

1) You're not trying to call the coroutine from Update, are you? That won't work.

2) Try yield return new WaitForSeconds(1.0F); <- just in case.

Comment
Add comment · Show 1 · 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 Peter G · Apr 26, 2011 at 02:45 AM 1
Share

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.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

No one has followed this question yet.

Related Questions

C# WaitForSeconds doesn't seem to work ?? 2 Answers

Getting an error when trying to yield 2 Answers

Scrolling Text StartCoroutine not working C# 2 Answers

yield works, but yield WaitForSeconds does not? 1 Answer

Fire and forget coroutines 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