roblox-camera
Skill1 starsChanged 4 months agoMITView on GitHub
Use when scripting Roblox camera behavior, CFrame placement, screen raycasts, first or third-person views, or cutscenes.
1 other project uses a version of this, 1 of them edited.
Adopted by
Most recently taken up by
- TabooHarmony/roblox-brainedited, first seen Sep 23, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 1
- TabooHarmony/roblox-brain★ 15060% same
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository32 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- roblox-analyticsSkill
- roblox-animated-modelsSkill
- roblox-animation-vfxSkill
- roblox-architectureSkill
- roblox-assetsSkill
- roblox-audioSkill
- roblox-buildingSkill
- roblox-cloudSkill
- roblox-code-reviewSkill
- roblox-dataSkill
- roblox-debugSkill
- roblox-guiSkill
- roblox-inputSkill
- roblox-lightingSkill
- roblox-localizationSkill
- roblox-luau-coreSkill
- roblox-luau-patternsSkill
- roblox-luau-typesSkill
- roblox-monetizationSkill
- roblox-networkingSkill
- roblox-npc-aiSkill
- roblox-oauthSkill
- roblox-performanceSkill
- roblox-physicsSkill
- roblox-publish-checklistSkill
- roblox-securitySkill
- roblox-server-dataSkill
- roblox-sharp-edgesSkill
- roblox-studio-mcpSkill
- roblox-toolingSkill
- roblox-ui-designSkill
The file
Files
When to Load
Load when scripting custom camera behavior (cutscenes, third-person follow, custom rotation), manipulating CFrame for placement/rotation, raycasting from the screen, or building a non-default player view. Client-only.
Quick Reference
The Camera: workspace.CurrentCamera — one per client. Set CameraType = Scriptable to disable defaults and take full control. Without it, defaults overwrite your CFrame every frame.
CameraType: Fixed, Attach/Watch/Track/Follow (subject-following), Custom (default), Scriptable (no default), Orbital (fixed Y, rotates around player). CameraSubject cannot be nil — setting it reverts.
Key properties: CFrame, CameraSubject, FieldOfView (deg), FieldOfViewMode (Vertical/Diagonal), NearPlaneZ, ViewportSize, HeadLocked, HeadScale, Focus.
CFrame essentials:
CFrame.new(pos)
CFrame.lookAt(at, lookAt, up?) -- preferred over deprecated CFrame.new(pos, lookAt)
CFrame.Angles(rx, ry, rz) -- XYZ Euler (radians)
cf * Vector3.new(0, 0, 10) -- local offset → world
cf:Lerp(goal, alpha) -- 0..1 linear interp
cf.LookVector / RightVector / UpVector -- world-space unit axesCustom camera loop — always RenderStepped, never Heartbeat:
camera.CameraType = Enum.CameraType.Scriptable
RunService.RenderStepped:Connect(function(dt)
local desired = CFrame.lookAt(head.Position - offset, head.Position)
camera.CFrame = camera.CFrame:Lerp(desired, math.min(dt * 10, 1))
end)Raycasting from camera: camera:ScreenPointToRay(mx, my) (accounts for GUI inset) vs camera:ViewportPointToRay(mx, my) (raw, NO inset). ScreenPointToRay returns a unit Ray (1 stud) — multiply Direction by length for actual raycast.
Pitfalls:
- Client-only. Server sets silently dropped.
- Without
Scriptable, defaults overwrite your CFrame every frame. RenderSteppedfor camera (visual sync).Heartbeatadds 1-frame lag.Camera.CFramelacks VR head rotation — useGetRenderCFrame()for true view.SetRollis outdated — apply roll viaCFrame.Angles(0, 0, roll)on CFrame.CameraSubject = nilreverts to previous.CFrame.new(pos, lookAt)is legacy (back-compat only) — useCFrame.lookAt(at, lookAt)for new code.ScreenPointToRay≠ViewportPointToRay(GUI inset). UseScreenPointToRayfor mouse input.
See references/full.md for first/third-person recipes, cutscenes, screen shake, mouse-look, full API.
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.

