C#Beta
Callbacks
Callbacks are definition members that run synchronously at fixed points of each playback. Await Completion shows one in use.
Members
Section titled “Members”Each callback receives the playback’s TweenInstance<TTarget, TValue> handle; OnUpdate also receives the value it wrote. All default to null.
| Member | Runs |
|---|---|
OnAdd |
At activation, after the start value is captured |
OnStart |
Once, when the delay ends and playback begins |
OnUpdate |
After each write |
OnEnd |
On natural completion |
OnCancel |
When playback stops early: cancelled, target freed, owner exited, or runner disposed |
OnFinally |
Last, in every case, including faults |
Suppressing callbacks
Section titled “Suppressing callbacks”When ending callbacks touch the target, skip them once it’s gone:
| Member | Type | Default | Meaning |
|---|---|---|---|
SuppressCallbacksWhenTargetInvalid |
bool |
false |
Skip OnEnd, OnCancel, and OnFinally when the target or owner is gone, or playback ended with TargetFreed or OwnerExited |
Callback order
Section titled “Callback order”OnAdd, at activation after capture.OnUpdatewithFrom, only when the fill mode applies it during the delay.OnStart, once, when the delay ends and playback begins.OnUpdateat each sampled timeline boundary and eligible update, plus once more when completion restores the initial value.OnEndon natural completion, orOnCancelwhen playback stops early.OnFinally, in every case.
- The handle’s terminal state is visible before the terminal callbacks run, and each runs at most once.
- A tween cancelled before activation, or whose preparation failed, runs no callbacks.
- A long frame doesn’t replay the callbacks of the cycles it skipped.
- An exception in a callback faults the tween;
OnFinallystill runs. - Tweens started in a callback or after an await are independent: they begin on the next eligible update, with no inherited frame time. A Chain links timing instead.
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.