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.
In this repository253 other files it gives its agents.
- rbx-abtestSkill
- rbx-accessibilitySkill
- rbx-analytics-eventsSkill
- rbx-analytics-funnelsSkill
- rbx-analytics-readingSkill
- rbx-animationSkill
- rbx-anim-cutscenesSkill
- rbx-anim-npcSkill
- rbx-anim-proceduralSkill
- rbx-anim-rigsSkill
- rbx-anim-tweenSkill
- rbx-architectureSkill
- rbx-assets-audioSkill
- rbx-assets-id-policySkill
- rbx-assets-sanitizeSkill
- rbx-assetsSkill
- rbx-assets-toolboxSkill
- rbx-assets-webSkill
- rbx-audio-feedback-mapSkill
- rbx-audio-mixingSkill
- rbx-audio-musicSkill
- rbx-audio-sfxSkill
- rbx-audioSkill
- rbx-audio-spatialSkill
- rbx-badges-groupsSkill
- rbx-build-compositionSkill
- rbx-build-detailingSkill
- rbx-build-greyboxSkill
- rbx-buildingSkill
- rbx-build-interiorsSkill
- rbx-build-kitbashSkill
- rbx-build-landscapeSkill
- rbx-build-propsSkill
- rbx-build-scaleSkill
- rbx-build-structuresSkill
- rbx-camera-cutsceneSkill
- rbx-camera-shakeSkill
- rbx-chat-moderationSkill
- rbx-ciSkill
- rbx-combat-abilitiesSkill
- rbx-combat-hitregSkill
- rbx-combat-meleeSkill
- rbx-combat-rangedSkill
- rbx-combatSkill
- rbx-combat-statusSkill
- rbx-complianceSkill
- rbx-comprehendSkill
- rbx-controlsSkill
- rbx-data-crossserverSkill
- rbx-data-profilestoreSkill
- rbx-data-recoverySkill
- rbx-data-schemaSkill
- rbx-data-sessionlockSkill
- rbx-dataSkill
- rbx-design-difficultySkill
- rbx-design-loopSkill
- rbx-design-sheetSkill
- rbx-design-socialSkill
- rbx-economy-currenciesSkill
- rbx-economy-gachaSkill
- The first 60 shown.
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
- Very specific: line 80
Read: preferences.md (camera-feel likes/dislikes — smoothing, invert-Y, FOV taste) and the game's projects.md block (existing rig module …
≈ “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.
Files
rbx-camera-controllers
Laws
- 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. - Scriptable only while you own it. Set
CameraType = Enum.CameraType.Scriptableon rig start, restoreCustomin a teardown that runs on every exit path. A player stuck in a dead camera is a session killer. - One rig at a time. A single controller module with a
setMode(name)switch. Two scripts writingcamera.CFrameproduce the classic one-frame flicker war. - RenderStepped, never Heartbeat. Heartbeat runs after render — one full frame of lag.
Use
RunService:BindToRenderStep("Rig", Enum.RenderPriority.Camera.Value - 1, fn). - Rebind on respawn. Cache
HumanoidRootPart/HeadinsideCharacterAdded, 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 withcamera.CFrame:Lerp(desired, math.min(dt * 8, 1)). Mouse-wheel zoom: 2 studs per notch, clamped 2–30 (InputChangedonly — wheel never firesInputBegan). - Over-shoulder —
MouseBehavior = LockCenterwhile active; yaw/pitch accumulate frominput.Delta * 0.003rad/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 tohitDistance - 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 withLocalTransparencyModifier = 1— neverTransparency, which replicates to everyone. - Top-down — camera at
root.Position + Vector3.new(0, 35, 18)looking at the root; lerp position only (alphadt * 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 = Scriptablefirst (default controller fights it — jitter) - ☐ No pitch clamp — camera flips over the pole
- ☐ Legacy
CFrame.new(pos, lookAt)constructor instead ofCFrame.lookAt - ☐ Heartbeat-driven camera (one frame of drag on every motion)
- ☐ No
CharacterAddedrebind — camera dies on first respawn - ☐ Third-person rig with no wall-clip raycast
- ☐ Head hidden with
Transparencyinstead ofLocalTransparencyModifier
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.
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
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.

