#Why my Coroutine doesn't work

1 messages · Page 1 of 1 (latest)

thin cobalt
#

You misunderstand how coroutines work

#

Your coroutine is working fine. The problem is that you are not doing anything after the delay

next nimbus
#

i don't want to do anything

#

any ideas?

thin cobalt
#

What

next nimbus
#

in coroutine, I just want to delay it

thin cobalt
#

Which you are

#

And then the coroutine ends

#

Coroutines run completely independently of the code that starts them.
All you're doing here is telling the Win method to start the Delay coroutine. Start it. After the coroutine has started, it then continues on and sets the sprite

#

StartCoroutine does not wait for the coroutine to complete

next nimbus
#

but it does continue without delaying

thin cobalt
next nimbus
#

okay i will create a IEnumator Win itself

#

thx for help!!!

thin cobalt
#

np 👍

next nimbus
#

problem

#

StartCoroutine(Player.Win());

#

I want to do this

#

Can it be possible

#

@thin cobalt

thin cobalt
#

yes

next nimbus
#

That's why i gone for prev method but it didn't wrok

#

work*

#

bro are you get my point