Punch
Tweens.FX.punch()A damped oscillation for impacts and recoil. Starts and ends at rest with the default phase.
GDScriptBeta
Punch
Tweens.FX.punch()A damped oscillation for impacts and recoil. Starts and ends at rest with the default phase.
Shake
Tweens.FX.shake()Seeded noise for rumble and jitter. Reuse a seed to reproduce the same shape.
Breathe
Tweens.FX.breathe()A smooth rise and fall for a gentle pulse. One whole cycle returns to rest.
var recoil := Tweens.position_2d_x()recoil.by_value = 12.0recoil.duration = 0.4recoil.ease_function = Tweens.FX.punch(6.0)
Tweens.play(sprite, recoil)The sprite oscillates along X and returns to its baseline. The offset supplies strength; the factory’s default amplitude is 1.
| Setting | Change it to… |
|---|---|
| Frequency | Fit more oscillations into the duration |
| Amplitude | Multiply the displacement |
| Decay | Make punch or shake fade faster |
| Attack | Ease into punch or shake before fading out |
For independent axes, use shake_2d, punch_3d, or breathe_quaternion. These return vector or rotation offsets: sample them in a callback or custom interpolator rather than the scalar ease slot.
The effect reference shows vector sampling, restoration, and all factory arguments. For a shape of your own, write an ease function or draw a curve.
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.