tabooharmony/roblox-brain

roblox-camera

Use when scripting Roblox camera behavior, CFrame placement, screen raycasts, first or third-person views, or cutscenes.

Trending #7642 First seen Jun 30, 2026

Installation

$ npx skills add tabooharmony/roblox-brain --skill roblox-camera

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from tabooharmony/roblox-brain · top by installs.

npx skills add tabooharmony/roblox-brain

Browse all from tabooharmony/roblox-brain

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Repository health

Stars 42
License LICENSE
Default branch main
Open issues 0
Status Active

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 2,980 B
  • docs SUMMARY.md 138 B

History

  1. First seen on skills.sh
  2. First recorded snapshot · 433 installs

SKILL.md

Roblox Camera

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:

Operation Luau
Position only CFrame.new(position)
Look at target CFrame.lookAt(position, target, upVector)
XYZ rotation CFrame.Angles(rx, ry, rz)
Local to world cf * Vector3.new(0, 0, 10)
Interpolate cf:Lerp(goal, alpha)
Unit axes cf.LookVector, cf.RightVector, cf.UpVector

Custom camera loop: always PreRender, never Heartbeat:

camera.CameraType = Enum.CameraType.Scriptable
RunService.PreRender: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 the actual raycast.

Pitfalls:

  • Client-only. Server sets silently dropped.
  • Without Scriptable, defaults overwrite your CFrame every frame.
  • PreRender for camera (visual sync). Heartbeat adds 1-frame lag. RenderStepped still works but is superseded by PreRender.
  • Camera.CFrame lacks VR head rotation; use GetRenderCFrame() for the true view.
  • SetRoll is outdated; apply roll via CFrame.Angles(0, 0, roll) on CFrame.
  • CameraSubject = nil reverts to previous.
  • CFrame.new(pos, lookAt) is legacy (back-compat only); use CFrame.lookAt(at, lookAt) for new code.
  • ScreenPointToRayViewportPointToRay (GUI inset). Use ScreenPointToRay for mouse input.

See references/full.md for first/third-person recipes, cutscenes, screen shake, mouse-look, full API.