agentleFS
blushneybusiness-glitchblushneybusiness-glitch/roblox-omniskills/skills/rbx-camera-shake/SKILL.md

rbx-camera-shake

Skill0 starsChanged 3 months agoMITView on GitHub

Trauma-based screen shake that reads as impact, not vibration — one global trauma value, squared falloff, perlin-noise offsets, and a shared impulse vocabulary for every hit in the game. Use when the user says "screen shake", "camera shake", "impact kick", "recoil punch", "make explosions feel heavy", or when existing shake feels like buzzing, stacks from multiple scripts, or never stops. Do not use for the paired flash/hit-stop layer — load rbx-juice-screenfx — or for cutscene camera motion — load rbx-camera-cutscene instead.

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 0 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    One trauma system per game: Every source calls Shake.add(amount) on a single module.

    line 18
  2. Very specific:

    Read: preferences.md (the user's shake-intensity taste — some flag DISLIKE on heavy shake, which is a hard constraint) and …

    line 77

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

rbx-camera-shake

Laws

  1. One trauma system per game. Every source calls Shake.add(amount) on a single module; trauma clamps 0–1. Two scripts applying raw CFrame offsets multiply into nausea — this is the router's standing rule, enforce it when you find violators.
  2. Shake = trauma². Displayed magnitude is trauma * trauma, so a 0.3 tap is barely visible while a 0.9 slam fills the screen. Linear mapping is the #1 reason shake feels flat.
  3. Perlin, not random. Per-axis math.noise(seed, os.clock() * 20) with seeds 1/2/3 — coherent noise reads as force; math.random jitter reads as a rumble motor.
  4. Compose, never overwrite. Apply after the active rig writes: RunService:BindToRenderStep("Shake", Enum.RenderPriority.Camera.Value + 1, fn) and camera.CFrame = camera.CFrame * offset. Overwriting the base CFrame kills every other camera system.
  5. Rotation sells it. Max angular offset 2–4° roll/pitch/yaw, max translation 0.35 studs. Translation-only shake looks like the world moved, not the camera.
  6. Cosmetic, client-side — but server-sourced. World shakes broadcast from the server with a position payload; each client derives its own falloff. Never expose a remote that lets one client shake others, and never let the server trust any client shake report.

Recipes

  • The core loop — trauma = math.max(trauma - decay * dt, 0) with decay 1.2/s (a full 1.0 hit settles in ~0.8 s); when trauma is 0, write nothing and go idle — do not run noise math at zero.
  • Impulse vocabulary — landing/small hit +0.2, taking damage +0.35, nearby explosion +0.6, boss slam/death blow +1.0. One table at CONFIG-top; designers tune the table, not call sites.
  • Distance falloff — for world events: add(base * (1 - math.clamp((camPos - eventPos).Magnitude / 60, 0, 1))) — zero beyond 60 studs.
  • Sustained rumble — earthquakes/drills set a floor: trauma = math.max(trauma, 0.3) each frame while active, released when the source ends; never += per frame (it pins at 1).
  • Reduced motion — multiply final offset by the accessibility scale (1 / 0.3 / 0) from the settings toggle wired via rbx-ui-settings, rationale in rbx-accessibility.

Performance budget

Idle cost zero: the render-step callback early-returns (or unbinds) at trauma 0. Active cost: 6 math.noise calls + 2 CFrame constructions per frame, no allocations, ≤ 0.05 ms/frame. One module, one connection, for the entire game.

Load with

rbx-juice-screenfx — flash, vignette, and hit-stop pair with every shake impulse; don't ask, include it. rbx-vfx-impacts when the shake source is an explosion or hit effect. rbx-camera-controllers when a custom rig is active, so the shake layer binds after it.

AI-tells

  • ☐ math.random offsets — vibration, not impact
  • ☐ Linear trauma→magnitude mapping (small and big hits feel identical)
  • ☐ Shake overwrites camera.CFrame instead of composing onto it
  • ☐ Noise math still running every frame at trauma 0
  • ☐ Translation-only offsets, no roll/pitch/yaw
  • ☐ Each weapon/ability shipping its own private shake loop
  • ☐ No distance falloff on world explosions — everyone on the map shakes equally
  • ☐ No reduced-motion scale hook

Memory

Read: preferences.md (the user's shake-intensity taste — some flag DISLIKE on heavy shake, which is a hard constraint) and module-library.md (an existing trauma module gets reused, never duplicated). Write: the shipped module path into module-library.md; the game's tuned impulse table into its projects.md block after approval.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.