smithery/verekia

camera-shake

Shake the camera when the player takes damage or on impacts for visual feedback.

Installation

$ npx skills add smithery/verekia --skill camera-shake

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from smithery/verekia · top by installs.

npx skills add smithery/verekia

Browse all from smithery/verekia

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 1,181 B
  • docs SUMMARY.md 100 B

History

  1. First recorded snapshot · 0 installs

SKILL.md

Camera Shake

Shake the camera when the player takes damage or on impacts for visual feedback.

Technique

Instantly offset the camera's rotation on X (pitch) and Z (roll) axes, then smoothly return to the base rotation using exponential decay in useFrame.

Key Concepts

  • Store rotation offsets in a module-level object for external triggering
  • Use exponential smoothing: (target - current) (1 - Math.exp(-speed dt))
  • Apply offsets to camera.rotation.x and camera.rotation.z
  • Call shake(intensity) from anywhere to trigger the effect

Usage

const shake = (intensity = 0.05) => {
  rotationOffset.x = (Math.random() - 0.5) * intensity
  rotationOffset.z = (Math.random() - 0.5) * intensity
}

// In useFrame:
rotationOffset.x += addSmoothExp(rotationOffset.x, 0, 10, delta)
camera.rotation.x = rotationOffset.x

Related Skills

  • smooth-interpolation - Exponential smoothing formula details

This skill is part of verekia's r3f-gamedev.