# Tweens in scripts

> Aego 0.12.5 · development; docs build `4a32b816933e02930662f6a443cb25abe6050d090c55e237cbff5c44ae9b25f8`. [Build manifest](/docs-build.json).

A tween changes one property of a node from its current value to a target over a duration. Scripts start tweens with the functions of `aego/tween` and chain options on the result.

```aes
tween.ToFloat(node, "SpriteRenderer.Tint.a", 0, 0.5, curve.Linear).Delay(1).PingPong(-1)
```

- `ToFloat`, `ToVec2`, `ToVec3`, `ToColor` and `ToQuat` animate a property by its path. `Position` moves a 2D node.
- The easing is a preset from `aego/curve`, such as `curve.OutQuad` or `curve.OutBack`. `Curve` uses a curve field instead.
- Options such as `Delay`, `Loop`, `PingPong` and `Unscaled` go right after the call.
- `Completed` is a signal that fires once when the tween ends.

Every function and option is listed on the [aego/tween](/ref/aego/tween.md) page.

## Rules

- When the last leg ends, the property gets exactly the end value: `to`, or the start after an even number of ping-pong legs.
- A new tween on the same property of the same node stops the running one.
- A tween stops when its node, its component or its script is gone.
