I have a for loop: for EachGuy in ThatBigArray: EachGuy.TakeYourTurn()

This is TakeYourTurn(): print("I will begin moving the character!") $Tween.interpolate_property(EachGuy, "position" ,EachGuy.position, Vector2(0,0),1,Tween.TRANS_LINEAR) EachGuy.play("move") $Tween.start() yield($Tween,"tween_all_completed") print("I am the second part of the function!") EachGuy.play("idle")

I thought that the original "for" loop would wait until each guy was done before going on to the next one. It's why I used "yield" at all. They all seem to be going at once, and not waiting for each one to finish before starting the next.

So how could I make them do it one at a time? I assume it's some small change to the For loop, but...I don't know, and that's why I am here.

Yield causes the function it is called from to return immediately.

I would suggest referring to the documents: https://docs.godotengine.org/en/stable/getting_started/scripting/gdscript/gdscript_basics.html#coroutines-with-yield.

You can capture the return value of TakeYourTurn and then invoke resume() to complete the rest of the function manually.

However 'tween_all_completed' is also a signal not a method call. I think you might want to instead connect to the signal and enter an idle state from there.

2 years later