gamedev-unity/skills/unity-skills/skills/camera/SKILL.md
Control Unity Scene View and Game cameras — move/rotate the view, create and configure cameras, set FOV/clip planes/projection. Use when framing the Scene View, creating or adjusting cameras, tweaking FOV or clipping planes, or scripting camera setup, even if the user just says "镜头" or "相机". 控制 Unity Scene View 与游戏相机(移动/旋转视图、创建与配置相机、设置 FOV/裁剪面/投影);当用户要取景 Scene View、创建或调整相机、修改 FOV 或裁剪面时使用。
npx skillsauth add bernatmv/ai-rules unity-cameraInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Control the Scene View camera and Game Cameras (creation, transform, properties, screenshot, culling, orthographic toggle).
camera_set_transform, camera_create, camera_set_properties, camera_set_culling_mask, camera_screenshot, camera_sceneview_screenshot, camera_set_orthographic, camera_align_view_to_object, camera_look_at) need user grant; grant triggers a single server-side execution that returns the result.camera_get_info, camera_get_properties, camera_list) are SkillMode.SemiAuto — they run in all three modes without grant.DO NOT (common hallucinations):
camera_move / camera_rotate do not exist → use camera_set_transform (Scene View) or gameobject_set_transform (Game Camera)camera_set_fov does not exist → use camera_set_properties with fieldOfView parametercamera_* skills control two different cameras: camera_set_transform/camera_look_at/camera_align_view_to_object control the Scene View camera; camera_create/camera_set_properties/camera_screenshot control Game Camerascamera_delete does not exist → use gameobject_delete on the camera GameObjectRouting:
cinemachine modulecamera_set_properties / camera_get_properties (this module)scene_screenshot (scene module) = the Game View final composite (all cameras + UI; Play mode = live runtime frame); camera_screenshot (this module) = a single Game Camera off-screen render; camera_sceneview_screenshot (this module) = the editor Scene View (developer viewport, incl. grid/gizmos)camera_align_view_to_objectAlign Scene View camera to look at an object. Parameters:
name (string, optional): Target GameObject name.instanceId (int, optional): Target GameObject instance ID.path (string, optional): Target GameObject hierarchy path.camera_get_infoGet Scene View camera position and rotation. Parameters: None.
camera_set_transformSet Scene View camera position/rotation manually. Parameters:
posX, posY, posZ (float): Position.rotX, rotY, rotZ (float): Rotation (Euler).size (float, optional): Orthographic size or pivot distance (default 5).instant (bool, optional): Move instantly (default true).camera_look_atFocus Scene View camera on a world-space point. Parameters:
x, y, z (float): Target point.targetName or GameObject lookup. For object focus, use camera_align_view_to_object.camera_createCreate a new Game Camera.
| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| name | string | No | "New Camera" | Name of the new camera GameObject |
| x | float | No | 0 | Position X |
| y | float | No | 1 | Position Y |
| z | float | No | -10 | Position Z |
| addAudioListener | bool | No | false | Also attach an AudioListener component |
Returns: { success, name, instanceId }
camera_get_propertiesGet Game Camera properties (supports name/instanceId/path).
| Parameter | Type | Required | Default | Description | |-----------|------|----------|---------|-------------| | name | string | No | null | Name of the camera GameObject | | instanceId | int | No | 0 | Instance ID of the camera GameObject | | path | string | No | null | Hierarchy path of the camera GameObject |
Returns: { success, name, fieldOfView, nearClipPlane, farClipPlane, orthographic, orthographicSize, depth, cullingMask, clearFlags, backgroundColor, rect }
camera_set_propertiesSet Game Camera properties (FOV, clip planes, clear flags, background color, depth).
| Parameter | Type | Required | Default | Description | |-----------|------|----------|---------|-------------| | name | string | No | null | Name of the camera GameObject | | instanceId | int | No | 0 | Instance ID of the camera GameObject | | path | string | No | null | Hierarchy path of the camera GameObject | | fieldOfView | float? | No | null | Camera field of view | | nearClipPlane | float? | No | null | Near clipping plane distance | | farClipPlane | float? | No | null | Far clipping plane distance | | depth | float? | No | null | Camera rendering depth | | clearFlags | string | No | null | Clear flags (e.g. Skybox, SolidColor, Depth, Nothing) | | bgR | float? | No | null | Background color red component | | bgG | float? | No | null | Background color green component | | bgB | float? | No | null | Background color blue component |
Returns: { success, name }
camera_set_culling_maskSet Game Camera culling mask by layer names (comma-separated).
| Parameter | Type | Required | Default | Description | |-----------|------|----------|---------|-------------| | layerNames | string | Yes | - | Comma-separated layer names | | name | string | No | null | Name of the camera GameObject | | instanceId | int | No | 0 | Instance ID of the camera GameObject | | path | string | No | null | Hierarchy path of the camera GameObject |
Returns: { success, cullingMask }
camera_screenshotCapture a screenshot from a Game Camera to file.
| Parameter | Type | Required | Default | Description | |-----------|------|----------|---------|-------------| | savePath | string | No | "Assets/screenshot.png" | File path to save the screenshot | | width | int | No | 1920 | Screenshot width in pixels | | height | int | No | 1080 | Screenshot height in pixels | | name | string | No | null | Name of the camera GameObject | | instanceId | int | No | 0 | Instance ID of the camera GameObject | | path | string | No | null | Hierarchy path of the camera GameObject |
Returns: { success, path, width, height }
camera_sceneview_screenshotCapture the editor Scene View (the developer's editing viewport — can overlook the whole scene incl. off-camera objects). Distinct from scene_screenshot (Game View / player camera) and camera_screenshot (one Game Camera). By default captures the full Scene View incl. grid/gizmos/selection (on-screen read); auto-falls back to a clean offscreen render if the editor build lacks the internal API. The Scene View window must be open and visible for the overlay capture.
| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| filename | string | No | "sceneview.png" | Bare filename only (no path separators); saved under Assets/Screenshots/ |
| includeOverlays | bool | No | true | True = full Scene View with grid/gizmos/selection (falls back to a clean render if unsupported); false = clean offscreen scene render only |
Returns: { success, path, width, height, mode, note } — mode is "screen_with_overlays" or "offscreen_clean".
camera_set_orthographicSwitch Game Camera between orthographic and perspective mode.
| Parameter | Type | Required | Default | Description | |-----------|------|----------|---------|-------------| | orthographic | bool | Yes | - | True for orthographic, false for perspective | | orthographicSize | float? | No | null | Orthographic size (only applies in orthographic mode) | | name | string | No | null | Name of the camera GameObject | | instanceId | int | No | 0 | Instance ID of the camera GameObject | | path | string | No | null | Hierarchy path of the camera GameObject |
Returns: { success, orthographic, orthographicSize }
camera_listList all cameras in the scene.
| Parameter | Type | Required | Default | Description | |-----------|------|----------|---------|-------------|
Returns: { count, cameras: [{ name, instanceId, path, depth, orthographic, enabled }] }
Exact names, parameters, defaults, and returns are defined by GET /skills/schema or unity_skills.get_skill_schema(), not by this file.
development
Keyword research and validation with real search-demand data — never ship keywords from intuition alone. Probes Google Autocomplete per language (free, no account) to prove demand and discover the exact phrasing people type, checks SERPs for winnability, and uses Keyword Planner/Ahrefs/Semrush exports when the user has access. Activates when: choosing or reviewing SEO keywords, meta keywords, page titles, article topics or slugs, landing page copy targeting search, App Store/ASO keyword fields, multilingual keyword sets, 'what should we rank for', 'keyword analysis', or auditing why a page doesn't rank. Also invoke it as a validation pass whenever another skill or task produces a keyword list.
development
Automate YooAsset hot-update and asset bundles — build bundles, run Editor simulate builds, manage Collector groups, analyze BuildReport, and validate runtime. Use when building or simulating YooAsset bundles, configuring collectors, or validating hot-update assets, even if the user just says "热更" or "打AB包". 自动化 YooAsset 热更新与资源包(构建 bundle、编辑器模拟构建、管理 Collector 分组、分析 BuildReport、运行时校验);当用户要构建或模拟 YooAsset 资源包、配置 collector、或校验热更资源时使用。
development
Source-anchored design rules for YooAsset v2.3.18 — initialization, default-package shortcuts, play modes, asset handles, loading, updates, filesystem, build, and pitfalls. Use when writing or reviewing YooAsset code, initializing packages, loading assets via handles, setting up hot-update/download, or choosing a play mode, even if the user just says "热更" or "资源包". 为 YooAsset v2.3.18 提供源码锚定的设计规则(初始化、默认包快捷方式、运行模式、资源句柄、加载、更新、文件系统、构建、陷阱);当用户要编写或审查 YooAsset 代码、初始化 package、用句柄加载资源、配置热更/下载、或选择运行模式时使用。
data-ai
Last-resort guidance for safely hand-editing Unity serialized YAML (.unity/.prefab/.asset/.meta/ProjectSettings) — reference/fileID repair, GUID safety, and merge-conflict fixes. Use when REST cannot reach the change and YAML must be hand-edited — fixing m_Script GUIDs, broken fileID references, .meta files, or merge conflicts, even if the user just says "场景文件打不开" or "引用丢了". 安全手编 Unity 序列化 YAML(.unity/.prefab/.asset/.meta/ProjectSettings)的最后手段(引用/fileID 修复、GUID 安全、合并冲突修复);当 REST 无法触达、必须手编 YAML 时使用——修复 m_Script GUID、断裂 fileID 引用、.meta 文件或合并冲突。