C#Beta
Await Completion
Every start returns a handle. Await it to continue once the tween ends, or use it to pause and cancel the tween on the way.
Scripting it
Section titled “Scripting it”The remote’s buttons call this script’s methods. To build your own, attach it to a scene’s root Node2D, pick a Sprite2D for Sprite in the Inspector, and connect each button’s pressed signal to its method.
using Godot;using tweens.gd;
// The remote's buttons call these methods; Ended reports how the movement ended.public partial class PlaybackRemote : Node2D{ [Signal] public delegate void EndedEventHandler(Reason reason);
[Export] private Sprite2D sprite = null!; [Export] private Vector2 to = new(1024, 128);
private TweenInstance? movement;
public async void Start() { movement = sprite.TweenPosition(to, 2.4, InOut.SmootherStep); EmitSignalEnded(await movement.End); }
public void Pause() => movement?.Pause();
public void Resume() => movement?.Resume();
public void Cancel() => movement?.Cancel();}- Keep the handle.
TweenPositionreturns it at once, andStartkeeps it inmovement. - Await the end.
await movement.Endresumes once playback ends, with the reason:Completed,Cancelled, orOwnerExitedwhen the scene closes first. - Control it.
Pauseholds the current value untilResume.Cancelstops for good and keeps the latest value.
To stop every tween a node owns without keeping their handles, call sprite.CancelTweens().
React to the end
Section titled “React to the end”Await the handle to continue in the same method. End resumes however playback ended, so check the reason when the next step needs an arrival.
var movement = sprite.TweenPosition((400, 180), 0.6, Out.Cubic);
if (await movement.End == Reason.Completed) GD.Print("Arrived");A callback on the definition suits a small synchronous reaction. OnEnd runs only on natural completion.
var arrive = new Tweens.Position2D((400, 180), 0.6, Out.Cubic){ OnEnd = _ => GD.Print("Arrived"),};
sprite.Tween(arrive);OnFinally also runs when playback stops early or fails; callback order shows the whole lifecycle.
Would you like to know more?
Section titled “Would you like to know more?”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.