- Home /
Update() cannot be a coroutine
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 unityGE$$anonymous$$S.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.
Your answer
Follow this Question
Related Questions
coroutines : trouble editing and accessing the same public variable 4 Answers
convert timer from update() to coroutine or invokerepeating 0 Answers
Unity error 2 Answers
Migration from Unity 5.5.0f3 to Unity 2017- error and HoloLens app not building 0 Answers
Why do I get error when using yield? 1 Answer