---
title: "layer.shake: Shake — Motion kit command — Kition"
description: "Adds a deterministic decaying shake from `frame` (comp seconds) to a layer's position and rotation, or a camera's position, point of interest and Z rotation: `amplitude` px and `rotation` degrees falling off by exp(-decay t) at `frequency` Hz with phases from `seed`; zero before `frame`; written as an expression on top of the existing keys or expression. One undo step."
canonical: "https://developer.kition.ai/docs/kits/motion/commands/layer.shake"
---

> Canonical HTML: [https://developer.kition.ai/docs/kits/motion/commands/layer.shake](https://developer.kition.ai/docs/kits/motion/commands/layer.shake)

# layer.shake

**Shake.** Adds a deterministic decaying shake from `frame` (comp seconds) to a layer's position and rotation, or a camera's position, point of interest and Z rotation: `amplitude` px and `rotation` degrees falling off by exp(-decay t) at `frequency` Hz with phases from `seed`; zero before `frame`; written as an expression on top of the existing keys or expression. One undo step.

- Kit: Motion 0.1.0 (.kmotion); reference: [Motion kit commands](https://developer.kition.ai/docs/kits/motion.md)
- Changes the document: yes
- Acts on: `layer` (one id), which a run step’s `on` fills

## Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `amplitude` | `number` | no | pixels; default 14 |
| `camera` | `integer \| string \| boolean` | no | a camera layer, or true for the comp's top camera |
| `comp` | `integer \| string` | no |  |
| `decay` | `number` | no | per second: falls off as exp(-decay t), default 6 |
| `frame` | `number` | no | seconds; comp time of the hit; zero before it; default the current time |
| `frequency` | `any` | no | Hz (default 12); default 12 |
| `layer` | `integer \| string` | no | the layer (or camera layer) to shake |
| `quality` | `string` | no | read by the command beside its listed parameters |
| `rotation` | `number` | no | degrees; default 1.5 |
| `seed` | `integer` | no | default 1 |
| `tracker` | `integer \| string` | no | read by the command beside its listed parameters |

## Call through motion_run

```text
motion_run {
  "path": "<file>.kmotion",
  "steps": [{ "command": "layer.shake" }]
}
```

The required parameters, with placeholders for their types: not a tested example. Optional: `amplitude`, `camera`, `comp`, `decay`, `frame`, `frequency`, `layer`, `quality`, `rotation`, `seed`, `tracker`. motion_run answers the step’s result in `completed[i].result`.

## Result

The kit gives no result schema for this command.

## Parameter schema

```json
{
  "additionalProperties": false,
  "properties": {
    "amplitude": {
      "description": "pixels; default 14",
      "type": "number"
    },
    "camera": {
      "description": "a camera layer, or true for the comp's top camera",
      "oneOf": [
        {
          "type": "integer"
        },
        {
          "type": "string"
        },
        {
          "type": "boolean"
        }
      ],
      "x-khp-name": "name",
      "x-khp-types": [
        "Layer"
      ]
    },
    "comp": {
      "oneOf": [
        {
          "description": "item id",
          "type": "integer"
        },
        {
          "description": "comp name",
          "type": "string"
        }
      ],
      "x-khp-name": "name",
      "x-khp-types": [
        "Item"
      ]
    },
    "decay": {
      "description": "per second: falls off as exp(-decay t), default 6",
      "type": "number"
    },
    "frame": {
      "description": "seconds; comp time of the hit; zero before it; default the current time",
      "type": "number"
    },
    "frequency": {
      "description": "Hz (default 12); default 12"
    },
    "layer": {
      "description": "the layer (or camera layer) to shake",
      "oneOf": [
        {
          "description": "layer id or 1-based index",
          "type": "integer"
        },
        {
          "description": "layer name or #n",
          "type": "string"
        }
      ],
      "x-khp-index": "#",
      "x-khp-index-numbers": true,
      "x-khp-name": "name",
      "x-khp-types": [
        "Layer"
      ]
    },
    "quality": {
      "description": "read by the command beside its listed parameters",
      "type": "string"
    },
    "rotation": {
      "description": "degrees; default 1.5",
      "type": "number"
    },
    "seed": {
      "description": "default 1",
      "type": "integer"
    },
    "tracker": {
      "description": "read by the command beside its listed parameters",
      "oneOf": [
        {
          "type": "integer"
        },
        {
          "type": "string"
        }
      ]
    }
  },
  "type": "object"
}
```

Generated from the command list of @kition/motion-darwin-arm64@0.1.0 and the kit itself (motion_commands through @kition/cli@0.1.1, built from KitionAI/kition-motion@4719aa7).
