x


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?

more ▼

asked Nov 01, 2012 at 11:51 AM

Makiavel gravatar image

Makiavel
45 29 1813 35

strongly suggest unityGEMS.com for explanation of Invoke() which is far simpler way to do timers.

Nov 01, 2012 at 02:16 PM Fattie
(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

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.

more ▼

answered Nov 01, 2012 at 12:11 PM

Montraydavis gravatar image

Montraydavis
1.5k 5 8 15

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)

Nov 01, 2012 at 12:47 PM Makiavel

You are not "bothering" . I am happy to assist you at any time . Thanks for you interest in Unity3D :) Glad this helps you.

Nov 01, 2012 at 03:20 PM Montraydavis
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

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

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x3617
x811
x634

asked: Nov 01, 2012 at 11:51 AM

Seen: 7258 times

Last Updated: Nov 01, 2012 at 03:20 PM