@@ -1482,6 +1482,20 @@ Will print::
world
cheers!
+Remember to save the new function state, when using multiple ``yield``s:
+
+::
+ func co_func():
+ for i in range(1, 5):
+ print("Turn %d" % i)
+ yield();
+ func _ready():
+ var co = co_func();
+ while co is GDScriptFunction && co.is_valid():
+ co = co.resume();
Coroutines & signals
^^^^^^^^^^^^^^^^^^^^