C#Beta
Timing
Timing places a tween in time: how long each leg takes, when the first one starts, how often it repeats, and what the property shows before and after. Loops & delays introduces it.
Members
Section titled “Members”| Member | Type | Default | Meaning |
|---|---|---|---|
Duration |
Duration |
0 |
Seconds per leg; zero completes on the first eligible update |
Delay |
Duration |
0 |
Signed wait before the first leg; a negative delay pre-rolls |
Offset |
Duration |
0 |
Start this far into the first forward leg, within [0, Duration]; the delay still comes first |
Repeats |
int |
0 |
Cycles after the first; TweenOptions.Infinite (-1) repeats until cancelled |
PingPong |
bool |
false |
Each cycle runs forward, then back |
PingPongInterval |
Duration |
0 |
Wait at the far endpoint before returning |
RepeatInterval |
Duration |
0 |
Wait between cycles, never after the last |
Fill |
FillMode |
RetainFinalValue |
What the property shows during the delay and after natural completion |
FactorDuration, DeltaDuration, FactorDelay, and DeltaDelay adjust Duration and Delay for each start; see variations.
Duration is also a readonly record struct of double seconds. It converts implicitly from float, double, and TimeSpan, and back to double; Seconds reads the value. Its default is zero.
Cycles
Section titled “Cycles”A cycle is one leg, or a forward leg, the ping-pong interval, and a return leg. Repeat intervals separate cycles:
var bob = new Tweens.Position2DY{ By = -20, Duration = 0.5, PingPong = true, PingPongInterval = 0.2, RepeatInterval = 0.3, Repeats = 1,};A ping-pong tween ends at its starting endpoint, so that endpoint is its final value.
Fill and restoration
Section titled “Fill and restoration”FillMode |
During the initial delay | On natural completion |
|---|---|---|
RetainFinalValue |
Leave the property alone | Keep the final value |
ApplyFromDuringDelay |
Apply From |
Restore the captured initial value |
Both |
Apply From |
Keep the final value |
None |
Leave the property alone | Restore the captured initial value |
RetainFinalValueis the default.Bothsuits staggered entrances: items still waiting show theirFromvalue.- Cancelling always keeps the latest value, whatever the fill mode.
- Restoring a shader uniform also restores whether the material had an explicit override; see the material reference.
- Non-finite times, and negative durations, intervals, or offsets, throw when the tween starts.
- An infinitely repeating cycle that takes zero time is rejected.
- A long frame advances to the correct phase, even across several cycles, without losing time at boundaries. It doesn’t replay the callbacks of the cycles it skipped.
- In a Chain, each entry’s delay counts from the end of the entry before it.
- The clock that advances a tween, and whether time scale applies, is chosen when it starts; see playback options.
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.