AGENT SKILL

unity-camera

Unity Scene View + Game Camera control. Use when users want to move/rotate the editor view, create or configure scene cameras, change FOV / clip planes / culling mask, switch orthographic vs perspective, or capture a screenshot. Triggers (EN): Unity camera, scene camera, Game Camera, Scene View, viewport, FOV, field of view, near/far clip, culling mask, orthographic, perspective, look at, align view, screenshot, render to file. Triggers (ZH): 相机, 摄像机, 视角, 视野, 场景视图, 游戏相机, 截图, 渲染截图, 正交, 透视, 裁剪面, 剔除遮罩.

License 许可
MIT
最近更新
2026-07-25
Stars
★ 8
Forks
0

01 前言 Front Matter

name
unity-camera
metadata
{ "tier": 2, "source": "https://github.com/Besty0728/Unity-Skills", "version": "1.9.2" }
use-when
Load when the task requires: Unity Scene View + Game Camera control. Use when users want to move/rotate the editor view, create or configure scene cameras, change FOV / clip planes / culling mask, switch orthographic vs perspective, or capture a screenshot. Triggers (EN): Unity camera, scene camera, Game Camera, Scene View, viewport, FOV, field of view, near/far clip, culling mask, orthographic, perspective, look at, align view, screenshot, render to file. Triggers (ZH): 相机, 摄像机, 视角, 视野, 场景视图, 游戏相机, 截图, 渲染截图, 正交, 透视, 裁剪面, 剔除遮罩. Unity Editor must be running with the unity-skills REST server reachable at http://localhost:8090.
platforms
[ "unity-editor", "claude-code" ]
description
Unity Scene View + Game Camera control. Use when users want to move/rotate the editor view, create or configure scene cameras, change FOV / clip planes / culling mask, switch orthographic vs perspective, or capture a screenshot. Triggers (EN): Unity camera, scene camera, Game Camera, Scene View, viewport, FOV, field of view, near/far clip, culling mask, orthographic, perspective, look at, align view, screenshot, render to file. Triggers (ZH): 相机, 摄像机, 视角, 视野, 场景视图, 游戏相机, 截图, 渲染截图, 正交, 透视, 裁剪面, 剔除遮罩.
do-not-use-when
Do not load when Unity Editor is not running locally. Do not load when unity-skills REST server is unreachable at http://localhost:8090. For Cinemachine virtual cameras → use `cinemachine` module instead.
task-categories
[ "camera", "cinemachine", "editor-automation" ]

03 SKILL.md 正文

Camera Skills

Control the Scene View camera and Game Cameras (creation, transform, properties, screenshot, culling, orthographic toggle).

Operating Mode

  • Approval (default): mutating skills (camera_set_transform, camera_create, camera_set_properties, camera_set_culling_mask, camera_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.
  • Auto / Bypass: those skills execute directly.
  • Query skills (camera_get_info, camera_get_properties, camera_list) are SkillMode.SemiAuto — they run in all three modes without grant.
  • This module contains no Delete / PlayMode / Reload / high-risk skills (no NeverInSemi).

Guardrails

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 parameter
  • camera_* 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 Cameras
  • camera_delete does not exist → use gameobject_delete on the camera GameObject

Routing:

  • For Cinemachine virtual cameras → use cinemachine module
  • For Game Camera component properties → camera_set_properties / camera_get_properties (this module)
  • For scene screenshots → scene_screenshot (scene module) uses the Scene View; camera_screenshot uses a Game Camera

Skills

camera_align_view_to_object

Align 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_info

Get Scene View camera position and rotation. Parameters: None.

camera_set_transform

Set 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_at

Focus Scene View camera on a world-space point. Parameters:

  • x, y, z (float): Target point.
  • Does not support targetName or GameObject lookup. For object focus, use camera_align_view_to_object.

camera_create

Create 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_properties

Get 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_properties

Set 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_mask

Set 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_screenshot

Capture 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_set_orthographic

Switch 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_list

List all cameras in the scene.

Parameter Type Required Default Description

Returns: { count, cameras: [{ name, instanceId, path, depth, orthographic, enabled }] }


Exact Signatures

Exact names, parameters, defaults, and returns are defined by GET /skills/schema or unity_skills.get_skill_schema(), not by this file.

04 同仓库更多 Skills

dyCuong03
dyCuong03/unity-agent-team

dots-update-groups

How to choose the right ECS system group and ordering so per-frame and per-fixed-step work is deterministic and never races its own readers. Covers InitializationSystemGroup / SimulationSystemGroup / PresentationSystemGroup / FixedStepSimulationSystemGroup / VariableRateSimulationSystemGroup, UpdateBefore / UpdateAfter peer ordering, OrderFirst / OrderLast group-boundary placement, RateManager, and the cross-group ordering trap. Use when adding an ISystem, fixing "value visible one frame late" bugs, or coupling simulation to a fixed timestep.

★ 8
dyCuong03
dyCuong03/unity-agent-team

dots-transform-patterns

The Entities 1.x transform model — LocalTransform (writable input) vs LocalToWorld (system-owned matrix), Parent/Child hierarchy, reparenting cost, uniform vs non-uniform scale (PostTransformMatrix), and when to opt out with custom transform systems. Use when designing parent/child hierarchies, runtime reparenting (mount/dismount/socket), or choosing transform components at the Baker boundary.

★ 8
dyCuong03
dyCuong03/unity-agent-team

dots-singleton-patterns

Model cross-system shared configuration and game state as a single-entity component with a strict single-writer contract. Covers RequireForUpdate gating, SystemAPI.GetSingleton / GetSingletonRW / HasSingleton / TryGetSingleton, bake-time vs runtime-created vs ECB-system singletons, the "exactly one entity" runtime invariant, and the single-writer rule. Use when designing frame-stable global config, shared mutable state, or any component intended to exist on exactly one entity.

★ 8
dyCuong03
dyCuong03/unity-agent-team

dots-hybrid-bridge

The one-way bridge between DOTS-owned runtime state and Unity-owned presentation. Covers UnityObjectRef for managed asset refs in components, the DOTS-writes / Unity-reads ownership rule, when to use managed IComponentData vs UnityObjectRef vs CompanionComponent, baker-bridge vs runtime-bridge, and SubScene boundary rules. Use when an entity must reference Unity assets (Mesh, Material, AudioClip, ScriptableObject), a MonoBehaviour view must read entity state, or input/UI must trigger ECS work.

★ 8
dyCuong03
dyCuong03/unity-agent-team

dots-event-driven-ecs

Model one-frame events and external requests in ECS without dual ownership, polling, or persistent state leaks. Covers request-tag pattern with ECB, enableable command components (no structural change), event buffers (IBufferElementData), explicit consumer ownership, one-frame latency rules, and the banned C# event / UnityEvent / static bus anti-patterns. Use when input/UI/network must trigger ECS work, when a one-frame signal fans out to N consumers (damage, hit, collision), or when state changes must be processed exactly once.

★ 8
dyCuong03
dyCuong03/unity-agent-team

valid_skill

A complete, well-formed test fixture skill for SkillHub validation testing. Covers basic task routing and code review for Unity projects.

★ 8