Skip to content
tweens.gd

GDScriptBeta

Reuse a Definition

A tween definition is a motion you can re-use on any compatible Node.

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.
var hop := Tweens.position_2d_y()
hop.by_value = -80.0
hop.duration = 0.25
hop.ease = Out.QUAD
hop.ping_pong = true

for i in icons.size():
	Tweens.play(icons[i], hop.with_delay(i * 0.2))

Changes apply to the next wave. Icons in the air keep the settings they started with.

In a 2D scene, drag icon.svg into the viewport a few times, side by side. Attach this script to the scene’s root Node2D and run it.

hop_wave.gd
extends Node2D
func _ready() -> void:
var hop := Tweens.position_2d_y()
hop.by_value = -80.0
hop.duration = 0.25
hop.ease = Out.QUAD
hop.ping_pong = true
var icons := get_children()
for i in icons.size():
Tweens.play(icons[i], hop.with_delay(i * 0.2))
  1. Define once. hop lifts a node 80 pixels and drops it back; negative y is up in Godot. by_value is relative, so each icon hops from wherever it stands.
  2. Find the nodes. Every child of this node.
  3. Start a copy on each. with_delay() copies hop with a new delay, so hop itself keeps none. Each start returns its own handle.

Each start snapshots its definition. Change hop later, and only the starts after that follow; tweens already playing keep their settings.

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.