Quick answer: Godot 4 Tween restart called during the same tick as the final step never emits 'finished'? Tweens auto-kill on completion - check valid before restart or use loops.
Bouncing UI animation: on hit, restart the tween. Sometimes the tween dies silently and the panel stays stuck.
Check is_valid
if tween.is_valid():
tween.stop()
tween.play()
else:
create_tween_again()Invalid means it auto-killed. Recreate or skip - never assume restart works.
Use set_loops for repeating animations
If the tween should repeat indefinitely, tween.set_loops(0). Removes the kill-on-finish path entirely.
Bind to a node that won't free
Tweens auto-free when their binding node is freed. For long-lived animations, bind to an autoload that outlives scenes.
“Godot 4 tweens are auto-managed. Restart-after-finish requires explicit handling.”
For UI animations, prefer AnimationPlayer over Tween. AnimationPlayer can be restarted reliably; Tween is best for one-shot procedural transitions.