Skip to content
tweens.gd

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.

var recoil = new Tweens.Position2DX
{
By = -12,
Duration = 0.2,
Ease = InOut.Quad,
PingPong = true,
};
sprite1.Tween(recoil with { FactorBy = 2 }); // 24 pixels back
sprite2.Tween(recoil with { FactorDuration = 1.5 }); // 0.3 seconds each way
sprite3.Tween(recoil with { DeltaDelay = 0.1 }); // 0.1 seconds later

Each copy follows the original: tune recoil, and every variation changes with it. Setting Duration on a copy instead replaces the duration outright.

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.

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.

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.
Offset over time, outward then return: InOut.Quad Skew Weks

The shared definition

static readonly Tweens.Position2DX Recoil = new()
{
    By = -12,
    Duration = 0.2,
    Ease = InOut.Quad,
    PingPong = true,
};

This start

this.Tween(Recoil with
{
    FactorBy = 2,
    FactorDuration = 1.2,
    Skew = 0.5,
    Weks = 0.5,
});

Kicks 24 px, 0.24 s each way

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.