Conversation
Reviewer's GuideAdds comprehensive documentation and workflows for the new Sequence diagram for third-person camera setup with manage_camerasequenceDiagram
actor User
participant MCPClient
participant manage_camera
participant UnityEditor
participant CinemachineBrain
participant CinemachineCamera
User->>MCPClient: manage_camera(action=ping)
MCPClient->>manage_camera: action=ping
manage_camera->>UnityEditor: CheckCinemachinePackage()
UnityEditor-->>manage_camera: cinemachineInstalled=true
manage_camera-->>MCPClient: availability status
MCPClient-->>User: Cinemachine available
User->>MCPClient: manage_camera(action=ensure_brain)
MCPClient->>manage_camera: action=ensure_brain
manage_camera->>UnityEditor: FindOrCreateMainCamera()
UnityEditor-->>manage_camera: mainCamera
manage_camera->>UnityEditor: EnsureCinemachineBrain(mainCamera)
UnityEditor-->>CinemachineBrain: AttachTo(mainCamera)
manage_camera-->>MCPClient: brain ensured
User->>MCPClient: manage_camera(action=create_camera, preset=third_person, follow=Player, lookAt=Player)
MCPClient->>manage_camera: action=create_camera
manage_camera->>UnityEditor: CreateCinemachineCamera(preset=third_person)
UnityEditor-->>CinemachineCamera: Instantiate()
manage_camera->>CinemachineCamera: ConfigureTargets(follow=Player, lookAt=Player)
manage_camera->>CinemachineCamera: SetPriority(20)
manage_camera-->>MCPClient: new camera info
User->>MCPClient: manage_camera(action=set_body, target=FollowCam)
MCPClient->>manage_camera: action=set_body, target=FollowCam
manage_camera->>CinemachineCamera: ConfigureBody(cameraDistance=5.0, shoulderOffset=[0.5,0.5,0])
manage_camera-->>MCPClient: body configured
User->>MCPClient: manage_camera(action=set_noise, target=FollowCam)
MCPClient->>manage_camera: action=set_noise, target=FollowCam
manage_camera->>CinemachineCamera: ConfigureNoise(amplitudeGain=0.3, frequencyGain=0.8)
manage_camera-->>MCPClient: noise configured
User->>MCPClient: manage_camera(action=screenshot, camera=FollowCam)
MCPClient->>manage_camera: action=screenshot, camera=FollowCam
manage_camera->>UnityEditor: RenderFromCamera(FollowCam)
UnityEditor-->>manage_camera: image data
manage_camera-->>MCPClient: base64 PNG
MCPClient-->>User: screenshot result
Sequence diagram for multi-camera blending and force overridesequenceDiagram
actor User
participant MCPClient
participant manage_camera
participant UnityEditor
participant CinemachineBrain
participant GameplayCam
participant CinematicCam
User->>MCPClient: manage_camera(action=create_camera, name=GameplayCam, preset=follow, priority=10)
MCPClient->>manage_camera: action=create_camera
manage_camera->>UnityEditor: CreateCinemachineCamera(name=GameplayCam, preset=follow)
UnityEditor-->>GameplayCam: Instantiate()
manage_camera->>GameplayCam: ConfigureTargets(follow=Player, lookAt=Player)
manage_camera->>GameplayCam: SetPriority(10)
manage_camera-->>MCPClient: gameplay camera info
User->>MCPClient: manage_camera(action=create_camera, name=CinematicCam, preset=dolly, priority=5)
MCPClient->>manage_camera: action=create_camera
manage_camera->>UnityEditor: CreateCinemachineCamera(name=CinematicCam, preset=dolly)
UnityEditor-->>CinematicCam: Instantiate()
manage_camera->>CinematicCam: ConfigureTargets(lookAt=CutsceneTarget)
manage_camera->>CinematicCam: SetPriority(5)
manage_camera-->>MCPClient: cinematic camera info
User->>MCPClient: manage_camera(action=set_blend, style=EaseInOut, duration=2.0)
MCPClient->>manage_camera: action=set_blend
manage_camera->>CinemachineBrain: ConfigureDefaultBlend(style=EaseInOut, duration=2.0)
manage_camera-->>MCPClient: blend configured
User->>MCPClient: manage_camera(action=force_camera, target=CinematicCam)
MCPClient->>manage_camera: action=force_camera
manage_camera->>CinemachineBrain: ForceCamera(CinematicCam)
CinemachineBrain-->>GameplayCam: DeactivateAsLive()
CinemachineBrain-->>CinematicCam: ActivateAsLiveWithBlend()
manage_camera-->>MCPClient: override applied
User->>MCPClient: manage_camera(action=release_override)
MCPClient->>manage_camera: action=release_override
manage_camera->>CinemachineBrain: ReleaseOverride()
CinemachineBrain-->>GameplayCam: SelectByPriority()
manage_camera-->>MCPClient: override released
Flow diagram for manage_camera tier selection and fallbackflowchart TD
Start[Start manage_camera call]
A[Receive action]
B{Is action Tier1?}
C{Is Cinemachine installed?}
D[Tier1 path
create_camera
set_target
set_lens
set_priority
list_cameras
screenshot
screenshot_multiview]
E[Tier2 path
ensure_brain
get_brain_status
set_body
set_aim
set_noise
add_extension
remove_extension
set_blend
force_camera
release_override]
F[Use Unity Camera
implementation]
G[Use Cinemachine
integration]
H[Return error with
fallback suggestion]
I[Return result]
Start --> A --> B
B -- Yes --> D
B -- No --> C
D --> F --> I
C -- Yes --> E
C -- No --> H --> I
E --> G --> I
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- The
manage_cameradocs mix top-level parameters (camera,include_image, etc.) with the genericpropertiesdict in different examples; consider explicitly stating which arguments are expected as root-level vs insidepropertiesfor each action (especiallyscreenshot/screenshot_multiview) to avoid ambiguity for tool callers. - In
tools/UPDATE_DOCS_PROMPT.md, the newunity-mcp-skill"Skill Update" step is quite vague ("Detect if this feature needs extra care via Skills"); adding a short, concrete criterion or example of what "extra care" means here will make it easier for automation to apply this rule consistently.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The `manage_camera` docs mix top-level parameters (`camera`, `include_image`, etc.) with the generic `properties` dict in different examples; consider explicitly stating which arguments are expected as root-level vs inside `properties` for each action (especially `screenshot`/`screenshot_multiview`) to avoid ambiguity for tool callers.
- In `tools/UPDATE_DOCS_PROMPT.md`, the new `unity-mcp-skill` "Skill Update" step is quite vague ("Detect if this feature needs extra care via Skills"); adding a short, concrete criterion or example of what "extra care" means here will make it easier for automation to apply this rule consistently.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (8)
📝 WalkthroughWalkthroughThis PR adds comprehensive documentation for a new Camera tool (manage_camera) with Cinemachine support across multiple reference files. It includes tool definitions, workflow examples, resource references, and updates the ProBuilder tool parameter signature to accept both dictionary and JSON string formats. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
This PR updates the unity-mcp-skill documentation to cover the new unified camera feature (manage_camera) and the new camera inspection resource (mcpforunity://scene/cameras), including example workflows and tool/reference entries.
Changes:
- Added a new “Camera & Cinemachine Workflows” section with example recipes (third-person, blending, inspection, non-Cinemachine usage).
- Added
manage_camerato the tools reference (parameters, actions, tier behavior, examples). - Added a new camera resource entry for
mcpforunity://scene/camerasand linked camera functionality in SKILL docs.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| unity-mcp-skill/references/workflows.md | Adds camera/Cinemachine workflow recipes and examples. |
| unity-mcp-skill/references/tools-reference.md | Adds a new “Camera Tools” section documenting manage_camera. |
| unity-mcp-skill/references/resources-reference.md | Documents mcpforunity://scene/cameras resource and example payload. |
| unity-mcp-skill/SKILL.md | Adds manage_camera screenshot usage + tool table entry. |
| tools/UPDATE_DOCS_PROMPT.md | Extends docs-update prompt to include unity-mcp-skill updates. |
| .claude/skills/unity-mcp-skill/references/workflows.md | Mirrors the new camera workflows section for Claude skill docs. |
| .claude/skills/unity-mcp-skill/references/tools-reference.md | Mirrors the manage_camera tool reference in Claude skill docs. |
| .claude/skills/unity-mcp-skill/SKILL.md | Mirrors camera tool entry and screenshot guidance in Claude skill docs. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
| - `create_camera` — Create camera with optional preset. Properties: `name`, `preset` (follow/third_person/freelook/dolly/static/top_down/side_scroller), `follow`, `lookAt`, `priority`, `fieldOfView`. Falls back to basic Camera without Cinemachine. | ||
|
|
||
| **Configuration:** | ||
| - `set_target` — Set Follow and/or LookAt targets. Properties: `follow`, `lookAt` (GO name/path/ID) | ||
| - `set_priority` — Set camera priority for Brain selection. Properties: `priority` (int) |
There was a problem hiding this comment.
The docs state that follow/lookAt (and set_target) accept GameObject "path" values, but the current Unity implementation only resolves string targets by name (or by instance ID when numeric). Paths like Root/Player will not resolve for these fields unless the code is extended; consider updating this text to say "name or instance ID" (or document a workaround such as resolving a path to an instance ID first).
|
|
||
| ```python | ||
| # 1. Check Cinemachine availability | ||
| manage_camera(action="ping") |
There was a problem hiding this comment.
In this workflow, steps 2–5 (ensure_brain, set_body, set_noise) require Cinemachine. As written, the sequence proceeds immediately after ping even if Cinemachine is not installed, which will lead to predictable errors; consider adding a short conditional note (e.g., "if ping reports Cinemachine available") or pointing readers to the "Camera Without Cinemachine" section.
| manage_camera(action="ping") | |
| manage_camera(action="ping") | |
| # If ping reports Cinemachine is unavailable, skip steps 2–5 | |
| # and use the "Camera Without Cinemachine" workflow instead. |
| - `brain`: CinemachineBrain status — which camera is active, blend state | ||
| - `cinemachineCameras`: All CinemachineCamera components with pipeline info (body, aim, noise, extensions) | ||
| - `unityCameras`: All Unity Camera components with depth and FOV | ||
| - `cinemachineInstalled`: Whether Cinemachine package is available |
There was a problem hiding this comment.
The example/field descriptions imply brain is always present, but the Unity resource returns brain: null when Cinemachine isn't installed or when no CinemachineBrain exists in the scene. Consider documenting that brain may be null and that cinemachineInstalled should be checked before relying on Brain fields.
| - `brain`: CinemachineBrain status — which camera is active, blend state | |
| - `cinemachineCameras`: All CinemachineCamera components with pipeline info (body, aim, noise, extensions) | |
| - `unityCameras`: All Unity Camera components with depth and FOV | |
| - `cinemachineInstalled`: Whether Cinemachine package is available | |
| - `brain`: CinemachineBrain status — which camera is active, blend state. May be `null` when Cinemachine is not installed or when no `CinemachineBrain` exists in the scene; check `cinemachineInstalled` and/or whether `brain` is non-null before relying on Brain fields. | |
| - `cinemachineCameras`: All CinemachineCamera components with pipeline info (body, aim, noise, extensions) | |
| - `unityCameras`: All Unity Camera components with depth and FOV | |
| - `cinemachineInstalled`: Whether Cinemachine package is available; when `false`, Cinemachine-specific data such as `brain` and `cinemachineCameras` may be `null` or empty. |
| - `create_camera` — Create camera with optional preset. Properties: `name`, `preset` (follow/third_person/freelook/dolly/static/top_down/side_scroller), `follow`, `lookAt`, `priority`, `fieldOfView`. Falls back to basic Camera without Cinemachine. | ||
|
|
||
| **Configuration:** | ||
| - `set_target` — Set Follow and/or LookAt targets. Properties: `follow`, `lookAt` (GO name/path/ID) | ||
| - `set_priority` — Set camera priority for Brain selection. Properties: `priority` (int) |
There was a problem hiding this comment.
The docs state that follow/lookAt (and set_target) accept GameObject "path" values, but the current Unity implementation only resolves string targets by name (or by instance ID when numeric). Paths like Root/Player will not resolve for these fields unless the code is extended; consider updating this text to say "name or instance ID" (or document a workaround such as resolving a path to an instance ID first).
|
|
||
| ```python | ||
| # 1. Check Cinemachine availability | ||
| manage_camera(action="ping") |
There was a problem hiding this comment.
In this workflow, steps 2–5 (ensure_brain, set_body, set_noise) require Cinemachine. As written, the sequence proceeds immediately after ping even if Cinemachine is not installed, which will lead to predictable errors; consider adding a short conditional note (e.g., "if ping reports Cinemachine available") or pointing readers to the "Camera Without Cinemachine" section.
| manage_camera(action="ping") | |
| manage_camera(action="ping") | |
| # If ping reports Cinemachine is not available, skip steps 2–5 | |
| # and instead use the "Camera Without Cinemachine" workflow. |
Document updates for the new camera feature
Summary by Sourcery
Document camera management capabilities in the Unity MCP skill and surface them in the skill overview and update workflow docs.
New Features:
manage_cameratool documentation including parameters, actions, tiers, and examples to the tools reference.mcpforunity://scene/camerasresource for inspecting camera state.Enhancements:
manage_cameraalongside other core tools in the SKILL overview table and screenshot workflow examples.manage_probuilderproperties to be passed as a dict or JSON string in the tools reference.Documentation:
Summary by CodeRabbit
New Features
Documentation