|
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.
(comments are locked)
|
|
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.
(comments are locked)
|
|
Make sure you call your coroutine with : @PatHightree I have tried both checkForDelay() and "checkForDealy" both work the same :(
Oct 23 '11 at 04:57 PM
cookies
My bad, I didn't read your calling code... just blurted out my own most common mistake ;)
Oct 24 '11 at 07:30 AM
PatHightree
(comments are locked)
|

hmm it seems like my logic needs to be in the coroutine for it to delay. that seems a bit silly