Version 4.3
Sorry, the title it’s a bit generic but it’s hard to describe without some code…
I do this:
var card = create_card()
print("pre animate")
animate_card_draw(card, hand_position)
print("post animate")
[...]
func animate_card_draw(card: Card, hand_position: int) -> void:
print("animate start")
add_child(card)
var tween: Tween = get_tree().create_tween()
tween.tween_property(card, "position", hand_markers[card.hand_position].global_position, 1)
await tween.finished
print("animate end")
The output in console is:
pre animate
animate start
post animate
<and after the tween duration>
animate end
as a result if i do a loop to draw some cards i get the animations running in parallel while i want them to run one after the other to simulate drawing cards one by one.