# Replay: seek() method

> The seek() method of the Replay interface shows the state at a tick, from the full state at or before it.

The **`seek()`** method of the [`Replay`](/docs/client/replay) interface shows the state at a tick.

## Syntax

```ts
seek(tick)
```

### Parameters

`tick`
: A number: the room tick to show. It's rounded down, and clamped to the range from [`firstTick`](/docs/client/replay/firsttick) to [`lastTick`](/docs/client/replay/lasttick).

### Return value

None (`undefined`).

### Exceptions

None.

## Description

A seek starts from the full state at or before the tick and applies the ticks after it, so it's fast anywhere in a replay. The entities shown before leave and those at the tick enter, without the changes between, and players leave and join [`presence`](/docs/client/replay/presence) the same way. Then the [`tick` event](/docs/client/replay/tick-event) fires. Recorded messages between the two ticks are skipped: a [`message` event](/docs/client/replay/message-event) fires only while playing through its tick.

A replay that's playing carries on playing from the new tick.

## Examples

### Jumping to each goal

A match's goals are known by tick, so the viewer's buttons seek a few seconds before each one.

```ts
// goals.ts
import type { Replay } from "@irtio/client/replay";

export function goalButtons(replay: Replay, goals: number[]): HTMLButtonElement[] {
  return goals.map((tick, i) => {
    const button = document.createElement("button");
    button.textContent = `Goal ${i + 1}`;
    button.addEventListener("click", () => replay.seek(tick - 3 * replay.tickRate));
    return button;
  });
}
```

`seek()` clamps a tick before the first, so a goal in the first seconds starts at the beginning.

## See also

- [`Replay.step()`](/docs/client/replay/step)
- [`Replay.firstTick`](/docs/client/replay/firsttick)
- [Playing back](/docs/room/guides/replays#playing-back) in Replays and clips
