---
title: "oscillating"
description: "A knob that sweeps between `min` and `max` on its own, for any slot that takes a prop."
group: "space"
groupTitle: "Shapes, frames & warps"
categoryId: "motion"
categorySlug: "motion"
categoryTitle: "Motion & timing"
kind: "function"
sourceUrl: "https://github.com/shader-effects-inc/shaders/blob/main/packages/core/src/std/motion.ts#L194"
---

# oscillating

A knob that sweeps between `min` and `max` on its own, for any slot that takes a prop.

```ts
oscillating(opts: {rate?: number; min?: Expr | number; max?: Expr | number; offset?: number; clock?: SignalClock}): Scalar
```

Import `motion` from `shaders/std` and use `motion.oscillating`.

Same options as `oscillate`. By default it follows the page clock. Pass `clock: 'node'` to follow the layer's own speed prop instead, after declaring `animatedTime` on the definition.

## Parameters

| Name | Type | Notes |
|---|---|---|
| `opts` | `{rate?: number; min?: Expr \| number; max?: Expr \| number; offset?: number; clock?: SignalClock}` |  |

## Example

```ts
map: warps.twirl({center: p('center'), intensity: motion.oscillating({rate: 0.25, min: 0.4, max: 1.6, clock: 'node'})})
```

> **Tip.** Inside `map:` it always follows the layer's clock, so declare `animatedTime: {speed: 'speed'}` there.

## See also

- [`oscillate`](/docs/primitives/motion/oscillate) — A smooth back-and-forth between `min` and `max`.
- [`pulsing`](/docs/primitives/motion/pulsing) — A knob that switches on and off in a rhythm, for any slot that takes a prop.