I keep getting this error: Update() cannot be a coroutine
But when I click it, it doesn't even show the script, where I have a mistake, so I don't even know what's wrong. Is there any tutorial for this type of mistake or something like that?
strongly suggest unityGEMS.com for explanation of Invoke() which is far simpler way to do timers.
Answer by Montraydavis
Nov 01, 2012 at 12:11 PM
All you have to do is create another function, and then put your coroutines in that function, and that function inside of Update :D You can't have coroutines in Update.
It's blocked by Unity for performance / security reasons I believe.
God, I just realized how stupid the mistake was. I copied a part of the script into the update, and it had WaitForSeconds in it) Deleted it and it works fine, sorry to bother you)
You are not "bothering" . I am happy to assist you at any time . Thanks for you interest in Unity3D :) Glad this helps you.
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.
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).
To help users post good questions and use the site effectively we have posted a user guide. Please check it out.
Answers and Comments
11 People are following this question.
Locomotion system compatibility
Are these problems are related to a NGUI change (update)
Coroutine in Editor?
Figuring out Coroutines
What is the best approach? Coroutine or calculate the "Elapsed Time" in the Update?