#Coroutine

1 messages · Page 1 of 1 (latest)

ornate folio
#

Hello

#

oh this work

#

wait can you see this

stable badger
#

Yes

ornate folio
#

oh thats cool

#

okay so its not even possible to have a coroutine in void update

stable badger
#

No, they need to be outside of it.

ornate folio
#

but my code is in void update

stable badger
#

Coroutines are regular methods, just like Update, you add them to the class

#

You will have to move the code that needs to wait from Update to your coroutine

ornate folio
#

why doesnt this work

#

It doesnt let me add curly brackets

#

so how am i supposed to tell unity what this method is saying

stable badger
#

Look at how the documentation does it

ornate folio
#

tthey use the curly brackets

#

okay i got the brackets

#

but now the method is red

#

and the potential fixes dont work

stable badger
#

Good. You get the red underline because you need to yield at least once in that