GDScriptBeta
Anatomy of a Tween
Each tween is backed by a definition, describing where it goes, when it plays, how it paces, and what runs along the way. Every field has a default, so a definition sets only what it changes.
Once the addon is installed, you can use the Tweens class in a node script.
var arrive := Tweens.position_2d([400, 180], 0.6, Out.CUBIC)arrive.delay = 0.1arrive.ease |= In.LINEARarrive.on_end = func(_handle): print("Arrived")
var oops_very_late := arrive.with_delta_delay(2.0)
var movement := Tweens.play(sprite, oops_very_late)
await movement.end- Define. A definition helper has optional arguments for endpoint, timing, easing, and delay.
- Initialize. Set or mutate specifics you want when you’re getting into the weeds during production.
- React. Callbacks run at fixed points of each playback.
- Tweak. Last-minute modifications close to the action.
- Start. Starting playback snapshots the definition and returns a handle.
- Await.
endresumes with the reason playback ended.
Parameters
Section titled “Parameters”Tween definitions may consist of dozens of parameters. It’s dangerous to go alone, but the script editor’s autocompletion has got your back. Usually, you’ll find yourself relying on at most three or four of these, but there might be different needs for each tween.
Endpoints
Section titled “Endpoints”Where the motion starts and ends.
from_= nullvalue Start value. Leave it out to read the property’s current value as the tween starts.
to_= nullvalue End value. Leave it out to end at the value the property had at start.
by_= nullvalue An offset instead of
to_value. It adds on top of other changes to the property.initial_= 0.0value Start value of a callback-only definition, which has no property to read.
Timing
Section titled “Timing”When the motion plays, and how often.
duration= 0.0Seconds per leg. Zero completes on the first update.
delay= 0.0Wait before the first leg. A negative delay starts partway in.
offset= 0.0Start this far into the first forward leg. The delay still comes first.
repeats= 0Cycles after the first.
Tweens.INFINITErepeats until cancelled.ping_= falsepong Each cycle runs forward, then back to its start.
ping_= 0.0pong_ interval Wait at the far end before returning.
repeat_= 0.0interval Wait between cycles, never after the last.
fill= RETAIN_FINAL_VALUEWhat the property shows during the delay and after the end. Dashed: the alternatives.
Easing
Section titled “Easing”How the motion paces between its endpoints. The easing playground draws every curve.
ease= LINEARThe curve: an In, an Out, or one of each joined with
|.blend_= MAKIMAtype How a mixed pair joins in the middle.
blend= 0.1Width of the join window, from 0 to 1.
skew= 0.5Where the forward leg hands over from In to Out.
weks= 0.5Where the ping-pong return hands over: skew, backwards.
ease_= Callable()function Your own function of progress. It replaces
ease.curve= nullA Godot
Curvesampled over progress. It replacesease.
Color interpolation
Section titled “Color interpolation”Whole-color interpolation coordinates, alpha handling, and the target API’s RGB encoding. These settings do not affect scalar alpha channels.
color_= Tweens.ColorSpace.OKLABspace Working coordinates for whole-color interpolation.
alpha_= Tweens.AlphaMode.PREMULTIPLIEDmode Premultiply working coordinates by alpha before interpolation.
color_= Tweens.ColorEncoding.SRGBencoding RGB encoding accepted and returned at the Godot API boundary.
Callbacks
Section titled “Callbacks”Run code at fixed points of each playback.
Runs at activation, after the start value is captured.
Runs once, when the delay ends and the motion begins.
Runs after each write.
Runs on natural completion.
Runs when playback stops early: cancelled, target freed, owner exited, or runner disposed.
Runs last, regardless of how tween playback actually ended.
suppress_= falsecallbacks_ when_ target_ invalid Skips
on_end,on_cancel, andon_finallyonce the target or owner is gone.
Variations
Section titled “Variations”When a tween starts, each value becomes factor × value + delta. Variations has a smorgasbord of curves!
factor_= 1.0from Multiplies
from_value.delta_= nullfrom Then adds to
from_value.factor_= 1.0to Multiplies
to_value.delta_= nullto Then adds to
to_value.factor_= 1.0by Multiplies
by_value.delta_= nullby Then adds to
by_value.factor_= 1.0duration Multiplies
duration.delta_= 0.0duration Then adds seconds to
duration.factor_= 1.0delay Multiplies
delay.delta_= 0.0delay Then adds seconds to
delay, as in a per-start stagger.
Target
Section titled “Target”What the definition writes. The named helpers and Tweens.property() set these for you.
property= ^""Property path, set by the named helpers and
Tweens.property().adapter= nullAn adapter for other storage. Use it or
property, not both.target_= &""class The class a named helper checks at start.
value_= TYPE_NILtype The value type a named helper checks at start.
Most fields have a with_*() copy method, such as with_skew(); the definition reference lists them. Each name links to its row in the reference.
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.