GDScriptBeta
Sequences
A Chain plays motions one after another on one target’s timeline. A Group plays them at the same time.
Examples use the global Tweens class in a node script, with targets inside the scene tree.
Play in order
Section titled “Play in order”var animation := Tweens.chain(sprite, [ Tweens.position_2d([400, 180], 0.6), Tweens.scale_2d([1.2, 1.2], 0.2), Tweens.modulate_alpha(0.0, 0.3),])await animation.endThe sprite moves, grows, then fades. Each step reads its starting value when it begins, so it continues from where the previous step ended.
Overlap and gaps
Section titled “Overlap and gaps”An entry’s delay counts from the end of the entry before it. A positive delay leaves a gap; a negative one overlaps.
var animation := Tweens.chain(sprite, [ Tweens.position_2d([400, 180], 0.6), Tweens.modulate_alpha(0.0, 0.3).with_delay(-0.2),])- Move from 0 to 0.6 seconds.
- Fade from 0.4 to 0.7 seconds, overlapping the move’s last 0.2 seconds.
Play together
Section titled “Play together”var together := Tweens.play_all(sprite, [ Tweens.position_2d([400, 180], 0.6), Tweens.modulate_alpha(0.0, 0.6),])await together.endTweens.play_all() returns a Group. To group tween handles from different targets, use Tweens.group([first, second]). A Group ends when all its members have ended; if one stops early, the Group cancels the rest.
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.