# Tween animate any property over time with easing. ```{raw} html ▶ Run in browser ``` **Tags:** `2d` `animation` `tween` `tween()` smoothly drives a property from its current value to a target over a duration, optionally with an easing curve and repeats. It is a coroutine: hand it to `start_coroutine()` and the node's lifecycle runs it. This example races a marker along each row using a different easing function so you can see how the curves differ; every marker covers the same distance in the same time. ## What it demonstrates - `tween(obj, prop, target, duration, easing=...)` -- interpolate a scalar or a `Vec2` property (here, each marker's `position`). - Easing functions (`ease_linear`, `ease_in_quad`, `ease_out_quad`, `ease_in_out_cubic`, ...) shape the motion: slow-in, slow-out, both, or none. - `repeat` + `repeat_mode="yoyo"` to ping-pong the animation back and forth. - `start_coroutine()` to run a tween from a node. ## Source ```{literalinclude} ../../examples/features/2d/tween.py :language: python :linenos: ```