A yielded coroutine will resume execution after all the Update() methods in the current frame have been called. Use:
yield new WaitForEndOfFrame();
in your code rather than yield.
EDIT: Actually, I don't think you need the new keyword in UnityScript. =P
↧