camera-shake

Apply configurable pitch and roll camera shake via shake(intensity).

31|Updated Jan 19, 2026
One-click install
npx skills add https://github.com/verekia/r3f-gamedev --skill camera-shake
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: camera-shake
Source: https://github.com/verekia/r3f-gamedev/tree/main/skills/camera-shake
Command: npx skills add https://github.com/verekia/r3f-gamedev --skill camera-shake

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

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

Core Features & Use Cases

  • Exponential smoothing: rotation offsets are applied to camera.rotation.x and camera.rotation.z
  • External trigger via shake(intensity)
  • Lightweight integration with useFrame
  • Configurable intensity and axis control
  • Use Case: Damage, impacts, and explosions

Quick Start

Call shake(intensity) to trigger the camera shake and let the exponential decay return the camera to its base rotation.

Frequently Asked Questions about camera-shake

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add camera shake for visual feedback when a player takes damage in R3F?

To add camera shake in R3F, trigger the shake(intensity) function upon player damage to apply rotation offsets to the camera. Exponential smoothing then automatically decays the rotation back to its base state.

How does exponential smoothing work for camera shake in game development?

Exponential smoothing for camera shake works by applying module-level rotation offsets to the pitch and roll axes, then gradually reducing these offsets over time. This creates a natural decay effect using useFrame without manual tweening.

Can I control which axes are affected by the camera shake?

Yes, you can control the axes affected by the camera shake, which is limited to pitch and roll. The feature applies configurable intensity specifically to camera.rotation.x and camera.rotation.z for impacts and explosions.

What is the best way to trigger camera shake on impacts and explosions?

The best way to trigger camera shake on impacts is by calling the public shake(intensity) function. You pass a configurable intensity value, and the system handles the rotation offset and exponential decay automatically.

Does this camera shake implementation require external dependencies?

No, this camera shake implementation requires no external dependencies. It operates lightweight within the R3F useFrame loop to manage rotation offsets and exponential smoothing.

Why does my camera shake only affect pitch and roll?

Your camera shake only affects pitch and roll because the implementation deliberately limits axis-specific application to camera.rotation.x and camera.rotation.z. Yaw rotation is excluded to maintain directional stability during impacts.