I have a sprite that goes through waypoints by the Patrol function. I have
Which controls the movement of the sprite, if I comment it out, my sprite does not move. But when I have a Co-routine right before it, which delays for 9 seconds, but it is not delaying anything (but it's going into the coroutine as my "YEP" shows in debug)
and the coroutine code:
So when I run it, in debug this is shown "YEP:9" but nothing is delayed.
asked Oct 23 '11 at 04:40 PM
The code in a Coroutine after the yield return is going to run concurrently with the method that called it, So the delay effects code within the coroutine called after the yield.
If you simply want to delay execution for 9 seconds, take a look at Invoke.
Make sure you call your coroutine with :
answered Oct 23 '11 at 04:43 PM