사용 방법
- 설치 명령을 복사하고 자신의 에이전트 환경에 설치하기 전에 소스 패키지를 확인하세요.
- 필요한 도구, 인증 정보, 지원 환경은 원본 문서에서 확인하세요.
- 입력과 원하는 산출물을 설명하고 출처와 결과를 대조하세요.
npx skills add https://github.com/tabooharmony/roblox-brain --skill roblox-camera시작 전 확인
- 설치에는 모델 구독, API 한도, 파일 접근 권한이 포함되지 않습니다.
- 별점 수와 설치 수는 활동 지표이며 독립적인 품질·보안 검증이 아닙니다.
원본 저장소의 제목, 예시, 코드, 표, 링크, 이미지를 유지해 표시합니다.
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. PreRenderfor camera (visual sync).Heartbeatadds 1-frame lag.RenderSteppedstill works but is superseded byPreRender.Camera.CFramelacks VR head rotation; useGetRenderCFrame()for the true view.SetRollis outdated; apply roll viaCFrame.Angles(0, 0, roll)on CFrame.CFrame.new(pos, lookAt)is legacy (back-compat only); useCFrame.lookAt(at, lookAt)for new code.
See references/full.md for first/third-person recipes, cutscenes, screen shake, mouse-look, full API.


