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

rbx-camera-controllers

Skill0 starsChanged 3 months agoMITView on GitHub

Custom camera rigs that feel like top-game defaults — first person, third person, over-shoulder, top-down, and locked-axis cameras with wall-clip handling and respawn safety. Use when the user says "make it first person", "over-the-shoulder camera", "top-down view", "lock the camera", "GTA-style camera", or when the camera jitters, clips through walls, flips over the top, or fights the player's mouse. Do not use for cutscene camera paths — load rbx-camera-cutscene — or for driving cameras — load rbx-vehicles-tuning instead.

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 0 are distinctive, and 1 is 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.

  • 1

    Very specific

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

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

    Read: preferences.md (camera-feel likes/dislikes — smoothing, invert-Y, FOV taste) and the game's projects.md block (existing rig module …

    line 80

≈ “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-controllers

Laws

  1. Client-only, always. Camera writes from a server Script are silently dropped. Every rig lives in one LocalScript-driven module. Any gameplay value derived from the camera that reaches the server (aim direction, look target) is re-validated there — dot-product and range checks per rbx-security-anticheat; the client's camera is a claim, not a fact.
  2. Scriptable only while you own it. Set CameraType = Enum.CameraType.Scriptable on rig start, restore Custom in a teardown that runs on every exit path. A player stuck in a dead camera is a session killer.
  3. One rig at a time. A single controller module with a setMode(name) switch. Two scripts writing camera.CFrame produce the classic one-frame flicker war.
  4. RenderStepped, never Heartbeat. Heartbeat runs after render — one full frame of lag. Use RunService:BindToRenderStep("Rig", Enum.RenderPriority.Camera.Value - 1, fn).
  5. Rebind on respawn. Cache HumanoidRootPart/Head inside CharacterAdded, never at module top level. Stale references after death are the #1 camera bug report.

Recipes

  • Third-person follow — pivot = root position + 2 studs up; offset Vector3.new(0, 4, 12); desired = CFrame.lookAt(pivot + offset, pivot); smooth with camera.CFrame:Lerp(desired, math.min(dt * 8, 1)). Mouse-wheel zoom: 2 studs per notch, clamped 2–30 (InputChanged only — wheel never fires InputBegan).
  • Over-shoulder — MouseBehavior = LockCenter while active; yaw/pitch accumulate from input.Delta * 0.003 rad/px, pitch clamped ±math.rad(80); offset (right 2.5, up 2, back 8) rotated into yaw space. Wall clip: raycast pivot→camera each frame, on hit pull camera to hitDistance - 0.5.
  • First person — CFrame.new(head.Position) * CFrame.Angles(0, yaw, 0) * CFrame.Angles(pitch, 0, 0), pitch clamped ±math.rad(89). Hide the head with LocalTransparencyModifier = 1 — never Transparency, which replicates to everyone.
  • Top-down — camera at root.Position + Vector3.new(0, 35, 18) looking at the root; lerp position only (alpha dt * 6), keep rotation fixed so the world never swims.
  • Locked-axis (side-scroller) — freeze one world axis of the follow position; the player moves in a plane, the camera tracks the other two axes at alpha dt * 8.

Sensitivity, zoom limits, and invert-Y are CONFIG-top values wired to a settings screen via rbx-ui-settings, never hardcoded mid-function (contract in luau-contract.md).

Performance budget

One render-step connection for the whole rig; zero table allocations per frame (reuse locals, no closures created in the loop); camera math ≤ 0.1 ms/frame; wall-clip raycast is one ray with a cached RaycastParams; connection disconnected the moment the mode exits.

Load with

rbx-camera-shake — all impact motion composes through its trauma layer, never raw offsets here. rbx-input-bindings when the rig changes what keys do (aim toggle, shoulder swap). rbx-input-mobile for touch-drag look on phones — don't ask, include it. rbx-ui-settings for the sensitivity slider.

AI-tells

  • ☐ Camera code in a server Script (silently does nothing)
  • ☐ CFrame written without CameraType = Scriptable first (default controller fights it — jitter)
  • ☐ No pitch clamp — camera flips over the pole
  • ☐ Legacy CFrame.new(pos, lookAt) constructor instead of CFrame.lookAt
  • ☐ Heartbeat-driven camera (one frame of drag on every motion)
  • ☐ No CharacterAdded rebind — camera dies on first respawn
  • ☐ Third-person rig with no wall-clip raycast
  • ☐ Head hidden with Transparency instead of LocalTransparencyModifier

Memory

Read: preferences.md (camera-feel likes/dislikes — smoothing, invert-Y, FOV taste) and the game's projects.md block (existing rig module path, chosen offsets). Write: the shipped controller's module path into module-library.md; final offset/sensitivity values into the game's projects.md block once the user approves the feel.

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.