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.
To help users navigate the site 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.
Unity 4.0.1f2 update and script,fbx file errors,.
coroutines : trouble editing and accessing the same public variable
convert timer from update() to coroutine or invokerepeating
Coroutine error help