C#Beta
Variations
Derive a stronger, slower, or later version of one definition. Factors multiply its values and deltas add to them, when playback starts.
Examples use using Godot; and using tweens.gd; in a Node method, with targets inside the scene tree.
Scale a motion
Section titled “Scale a motion”var recoil = new Tweens.Position2DX{ By = -12, Duration = 0.2, Ease = InOut.Quad, PingPong = true,};
sprite1.Tween(recoil with { FactorBy = 2 }); // 24 pixels backsprite2.Tween(recoil with { FactorDuration = 1.5 }); // 0.3 seconds each waysprite3.Tween(recoil with { DeltaDelay = 0.1 }); // 0.1 seconds laterEach copy follows the original: tune recoil, and every variation changes with it. Setting Duration on a copy instead replaces the duration outright.
Vary the current value
Section titled “Vary the current value”Leave the destination out, and FactorTo scales the value captured at the start:
var beat = new Tweens.Scale2D{ FactorTo = 1.2, Duration = 0.15, Ease = InOut.SmootherStep, PingPong = true,};
sprite.Tween(beat);The sprite grows to 120% of its current scale and back.
Change the pacing
Section titled “Change the pacing”Skew shifts the outward leg’s balance between its In and Out halves; Weks does the same for the return. Both run from 0 (fast start) to 1 (fast finish), and 0.5 keeps the ease as written. Set Weks = 1 - Skew to retrace the outward curve.
Try it: change the shared recoil kick, and Hit and Crit follow it. Then move Skew: the pacing changes, the distance doesn’t.
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.