Skip to content
tweens.gd

GDScriptBeta

Lifetime and pausing

A node owns the tweens started on it. When it leaves the scene tree, they end, even while paused.

Examples use the global Tweens class in a node script, with targets inside the scene tree.

Target

The object that receives values: a node, material, or other supported object.

Owner

The node whose lifetime ends playback. A node tween’s owner is its target.

Start a tween once its node is in the tree, in _ready() or later; starting outside the tree logs an error and returns a FAILED handle. Removing or reparenting the node ends its tweens.

Tweens.cancel_tweens(node, true) cancels a whole branch. It reaches automatic playback, not manual schedulers.

pause_mode Playback follows
BOUND (default) The owner’s can_process(): its process mode and tree pause
SCENE_TREE Tree pause only
ALWAYS Neither; plays through pause

A pause menu with process_mode = PROCESS_MODE_ALWAYS keeps animating under BOUND. Pausing a handle holds it in every mode.

Try it: pause the tree, then change the pause mode.

Animations are paused

Reduce Motion is on, or Animation Effects are off.
(e.g. in your accessibility settings)

Applies to this demo until you reload.
  • root paused
  • Level
  • Sprite2D owner + target
Playingwait() pending…

Tweens.playback_options() sets the process mode, pause mode, and unscaled time, in that order. Pass the result after the owner; null makes the target its own owner:

var ui := Tweens.playback_options(Tweens.Process.PROCESS, Tweens.Pause.ALWAYS, true)
Tweens.play(label, Tweens.modulate_alpha(1.0, 0.3), null, ui)

This fade keeps its pace through pause and slow motion. Tweens.Process.PHYSICS would update it on physics frames instead.

A material isn’t in the tree, so its tweens take an owner: a node, or the scene tree. See materials and shaders. Tweens never duplicate or dispose the resources they animate.

tweens.gd is made with math & ferrets, copyright © 2026 its contributors.

Godot logo by Andrea Calabró, licensed under CC BY 4.0.

"Easy, the Ferret" illustrations drawn by foxy_maria.

tweens.gd is released under the MIT License.

Godot is licensed under the MIT License.
tweens.gd is not affiliated with or endorsed by the Godot Foundation.