# Camera Follow 2D

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

```
component camera.CameraFollow2D
```

Moves its virtual camera after Target, with a deadzone, damping and lookahead.

## Fields

| Name | Script name | Type | Default | Description |
|---|---|---|---|---|
| Target | `Target` | `NodeRef` | `none` | Node to follow; its interpolated position is used. |
| Deadzone | `Deadzone` | `Rect` | `(0.4, 0.4, 0.2, 0.2)` | Area of the view, in 0..1 of its width and height, where the target moves without moving the camera. |
| Damping | `Damping` | `Vec2` | `(6, 6)` | How fast the camera catches up, per second on each axis. 0 follows rigidly. |
| Lookahead | `Lookahead` | `Vec2` | `(0.25, 0)` | Seconds of target velocity the camera looks ahead on each axis. |
| Max Lookahead | `MaxLookahead` | `Vec2` | `(3, 1)` | Largest lookahead in world units on each axis. 0 is unlimited. |
| Lookahead Smoothing | `LookaheadSmoothing` | `float` | `3` | How fast the lookahead changes, per second. 0 changes at once. |
| Snap Distance | `SnapDistance` | `float` | `20` | A target jump longer than this, in world units, moves the camera at once. 0 never snaps. |

## Snap

```
func (CameraFollow2D) Snap()
```

Moves the camera onto the target at once, for example after a teleport.
