From 9f092b025fccb45c34df89f79c964247f4d9ead8 Mon Sep 17 00:00:00 2001 From: David Rynn Date: Thu, 14 May 2026 12:15:13 -0400 Subject: [PATCH 1/2] fix: correct scene_view positioned capture instructions Document that view_position and view_rotation are invalid with capture_source="scene_view", and show the SceneView.LookAt() workflow for taking positioned Scene View screenshots. --- unity-mcp-skill/SKILL.md | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/unity-mcp-skill/SKILL.md b/unity-mcp-skill/SKILL.md index 905561cc7..2fb18f2a4 100644 --- a/unity-mcp-skill/SKILL.md +++ b/unity-mcp-skill/SKILL.md @@ -98,10 +98,31 @@ manage_camera(action="screenshot", capture_source="scene_view", include_image=Tr manage_camera(action="screenshot", capture_source="scene_view", view_target="Canvas", include_image=True) ``` +> **Warning — `scene_view` + `view_position` unsupported:** Passing `view_position` or `view_rotation` with `capture_source="scene_view"` returns an error — these parameters are not valid for scene view capture. To take a positioned Scene View screenshot, first use `execute_code` with `SceneView.LookAt()` to move the Scene View, then capture the Scene View as-is with no framing or position parameters: +> +> ```csharp +> // Run via execute_code to reposition the scene view +> var sv = UnityEditor.SceneView.lastActiveSceneView +> ?? UnityEditor.EditorWindow.GetWindow(); +> sv.Focus(); +> sv.LookAt(new Vector3(0, 0, 0), Quaternion.Euler(60, 30, 0), 400f); +> sv.orthographic = false; +> UnityEditor.SceneView.RepaintAll(); +> return "positioned"; +> ``` +> +> ```python +> # Capture the Scene View as-is — do not pass view_target, view_position, or view_rotation, +> # as view_target would re-frame the viewport and override the LookAt() setup above. +> manage_camera(action="screenshot", capture_source="scene_view", include_image=True) +> ``` +> +> `LookAt(pivot, rotation, size)`: pivot = world-space orbit point; rotation = Euler angles (x=pitch, y=yaw; 90° pitch = top-down); size = zoom/distance. + **Best practices for AI scene understanding:** - Use `include_image=True` when you need to *see* the scene, not just save a file. - Use `batch="surround"` for a comprehensive overview (6 angles, one command). -- Use `view_target`/`view_position` to capture from a specific viewpoint without needing a scene camera. +- Use `view_target`/`view_position` to capture from a specific viewpoint without needing a scene camera. Note: `view_position` and `view_rotation` are **incompatible with `capture_source="scene_view"`** and return an error — use `SceneView.LookAt()` via `execute_code` instead (see warning above). `view_target` is supported with `scene_view`. - Use `capture_source="scene_view"` to see the editor viewport (gizmos, wireframes, grid). - Keep `max_resolution` at 256–512 to balance quality vs. token cost. From ddafba83093341ebda2865b0a219f86199b5be6b Mon Sep 17 00:00:00 2001 From: David Rynn Date: Thu, 14 May 2026 13:04:06 -0400 Subject: [PATCH 2/2] fix: make scene_view LookAt positioning deterministic --- unity-mcp-skill/SKILL.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/unity-mcp-skill/SKILL.md b/unity-mcp-skill/SKILL.md index 2fb18f2a4..5fb6c05dd 100644 --- a/unity-mcp-skill/SKILL.md +++ b/unity-mcp-skill/SKILL.md @@ -105,8 +105,7 @@ manage_camera(action="screenshot", capture_source="scene_view", view_target="Can > var sv = UnityEditor.SceneView.lastActiveSceneView > ?? UnityEditor.EditorWindow.GetWindow(); > sv.Focus(); -> sv.LookAt(new Vector3(0, 0, 0), Quaternion.Euler(60, 30, 0), 400f); -> sv.orthographic = false; +> sv.LookAt(new Vector3(0, 0, 0), Quaternion.Euler(60, 30, 0), 400f, false, true); > UnityEditor.SceneView.RepaintAll(); > return "positioned"; > ``` @@ -117,7 +116,7 @@ manage_camera(action="screenshot", capture_source="scene_view", view_target="Can > manage_camera(action="screenshot", capture_source="scene_view", include_image=True) > ``` > -> `LookAt(pivot, rotation, size)`: pivot = world-space orbit point; rotation = Euler angles (x=pitch, y=yaw; 90° pitch = top-down); size = zoom/distance. +> `LookAt(pivot, rotation, size, ortho, instant)`: pivot = world-space orbit point; rotation = Euler angles (x=pitch, y=yaw; 90° pitch = top-down); size = zoom/distance; ortho = orthographic mode; instant = apply immediately for deterministic screenshots. **Best practices for AI scene understanding:** - Use `include_image=True` when you need to *see* the scene, not just save a file.