Quick answer: A SceneTreeTween bound to a node dies when the node leaves the tree — mid-animation. If a persistent node must end in a known state, set the final value explicitly or wait for finished.

A UI panel slides in via a tween. The player changes scene mid-slide; later the panel (a persistent autoload child) is stuck half-on-screen — the tween was killed partway.

Tweens Bind to Their Creator

A tween created with create_tween() is bound to the node that created it. When that node exits the tree, the tween is killed — whatever value it was animating freezes at its last frame.

For Persistent Nodes: Snap to Final

func _exit_tree():
    # if a tween was mid-flight, jump to its end state
    if _slide_tween and _slide_tween.is_running():
        position = _target_position

Record the target value when you start the tween; apply it directly if you’re torn down early.

Or Bind to a Longer-Lived Node

If the animation should survive a scene change, create the tween on a node that persists (an autoload). Then it isn’t killed when the gameplay scene unloads.

Use the finished Signal

For cleanup that must happen exactly once when a tween ends naturally, connect to its finished signal — but remember it won’t fire if the tween is killed early. Pair it with the _exit_tree snap.

Verifying

Trigger the slide, change scene mid-animation, return. The panel is in a correct, fully-resolved state — never stuck halfway.

“A tween dies with its node. For persistent state, snap to the final value on early teardown.”

For UI that lives across scenes, create its tweens on the UI autoload itself — not on transient gameplay nodes.