---
title: Rewind(ref TimerState)
product: Unity Editor
version: '7000.0'
latest_version: '7000.0'
status: This page documents version 7000.0. The latest version is 7000.0.
canonical: https://docs.unity.com/en-us/engine/7000.0/script-reference/unity/animations/timerstateextensions/rewind
latest_url: https://docs.unity.com/en-us/engine/7000.0/script-reference/unity/animations/timerstateextensions/rewind.md
last_updated: 2026-11-30
generated_at: 2026-11-30T20:50:31.464Z
locale: en-us
---

# Rewind(ref TimerState)

> Rewinds a timer state to the start of its range.

## Definition

* **Type:** Method
* **Namespace:** [Unity.Animations](/engine/7000.0/script-reference/unity/animations.md)
* **Assembly:** [UnityEngine.AnimationCoreModule](/engine/7000.0/script-reference/modules/unityengine-animationcoremodule.md)

## Rewind(TimerState)

```csharp
public static void Rewind(this ref TimerState timerState)
```

### Parameters

**** (\[TimerState]\(/engine/7000.0/script-reference/unity/animations/timerstate)): The timer state to rewind. The method changes this timer state.

### Remarks

The method moves [TimerState.PreviousTime](/engine/7000.0/script-reference/unity/animations/timerstate/previoustime.md) and [TimerState.Time](/engine/7000.0/script-reference/unity/animations/timerstate/time.md) to the start of [TimerState.Range](/engine/7000.0/script-reference/unity/animations/timerstate/range.md) and sets [TimerState.DeltaTime](/engine/7000.0/script-reference/unity/animations/timerstate/deltatime.md) to zero. It doesn't change [TimerState.PlayState](/engine/7000.0/script-reference/unity/animations/timerstate/playstate.md), so a playing timer keeps playing.

When the wrap mode is [WrapMode.Loop](/engine/7000.0/script-reference/unityengine/wrapmode/loop.md), the method also applies [TimerState.CycleOffset](/engine/7000.0/script-reference/unity/animations/timerstate/cycleoffset.md). The time moves by the cycle offset times the duration of the range, and wraps back into the range. The method sets [TimerState.PreviousLoopCount](/engine/7000.0/script-reference/unity/animations/timerstate/previousloopcount.md) and [TimerState.LoopCount](/engine/7000.0/script-reference/unity/animations/timerstate/loopcount.md) to the cycle offset rounded down to a whole number. For example, with a range from `0` to `2`, a cycle offset of `1.25` sets [TimerState.Time](/engine/7000.0/script-reference/unity/animations/timerstate/time.md) to `0.5` and both loop counts to `1`, and a cycle offset of `-0.25` sets `Time` to `1.5` and both loop counts to `-1`. With any other wrap mode, the time stays at the start of the range and the method sets both loop counts to `0`.
