Skip to content

Skill update#888

Merged
Scriptwonder merged 1 commit intoCoplayDev:betafrom
Scriptwonder:skill-update
Mar 7, 2026
Merged

Skill update#888
Scriptwonder merged 1 commit intoCoplayDev:betafrom
Scriptwonder:skill-update

Conversation

@Scriptwonder
Copy link
Collaborator

@Scriptwonder Scriptwonder commented Mar 7, 2026

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:

  • Add manage_camera tool documentation including parameters, actions, tiers, and examples to the tools reference.
  • Introduce camera-related workflows covering third-person setup, multi-camera blending, non-Cinemachine usage, and inspection flows.
  • Document the mcpforunity://scene/cameras resource for inspecting camera state.

Enhancements:

  • Expose manage_camera alongside other core tools in the SKILL overview table and screenshot workflow examples.
  • Allow manage_probuilder properties to be passed as a dict or JSON string in the tools reference.
  • Extend the docs update prompt to consider Unity MCP skill updates for skills-aware doc changes.

Documentation:

  • Update both embedded and exported Unity MCP documentation copies to include camera tools, workflows, and resources, keeping them in sync.

Summary by CodeRabbit

  • New Features

    • Camera management tool with Cinemachine integration for advanced camera control and multi-view configurations
  • Documentation

    • Added Camera tool reference guide with complete parameter documentation and workflow examples
    • Introduced Camera & Cinemachine workflow documentation with setup and blending scenarios
    • Expanded Resources Reference with new Camera Resources section
    • Enhanced tool parameter documentation for improved flexibility

Copilot AI review requested due to automatic review settings March 7, 2026 07:46
@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Mar 7, 2026

Reviewer's Guide

Adds comprehensive documentation and workflows for the new manage_camera tool (camera + Cinemachine management) and introduces a camera scene resource, wiring them into the Unity MCP skill docs and update tooling.

Sequence diagram for third-person camera setup with manage_camera

sequenceDiagram
    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
Loading

Sequence diagram for multi-camera blending and force override

sequenceDiagram
    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
Loading

Flow diagram for manage_camera tier selection and fallback

flowchart 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
Loading

File-Level Changes

Change Details Files
Document the new manage_camera camera tool, including parameters, supported actions, examples, and its Cinemachine tiering model, and expose it in the tools table of contents.
  • Add a Camera Tools section to the tools reference with full docs for the manage_camera MCP tool, including parameters, screenshot-specific options, action categories, and example usage snippets.
  • Describe the tiered behavior when Cinemachine is installed vs not, including which actions are Tier 1 vs Tier 2 and the expected fallback/error behavior.
  • Update the tools reference table of contents to link to the new camera tools section.
  • Allow the properties field to be passed as a dict or JSON string to align with other tools’ behavior.
.claude/skills/unity-mcp-skill/references/tools-reference.md
unity-mcp-skill/references/tools-reference.md
Add documented camera and Cinemachine workflows showing practical sequences for common scenarios using manage_camera.
  • Introduce a Camera & Cinemachine Workflows section covering third-person setup, multi-camera with blending, camera usage without Cinemachine, and inspection workflows.
  • Provide stepwise, code-like examples for each workflow to illustrate recommended tool call sequences.
  • Link the new workflow section from the workflows table of contents.
.claude/skills/unity-mcp-skill/references/workflows.md
unity-mcp-skill/references/workflows.md
Introduce a camera-focused resource (mcpforunity://scene/cameras) and reference it from camera-related docs.
  • Add a Camera Resources section documenting the mcpforunity://scene/cameras resource, including example JSON payload, key fields, and its relationship to manage_camera.
  • Update the resources table of contents to include camera resources.
unity-mcp-skill/references/resources-reference.md
Integrate the new camera feature into the top-level Unity MCP skill description and the docs update automation prompt.
  • Extend SKILL.md to mention manage_camera in the tool capabilities table and show it as an alternative to manage_scene for screenshots, including its presets, tier model, and associated resource.
  • Adjust the ProBuilder tools description to note the correct supported shape count.
  • Update the docs update tool prompt (UPDATE_DOCS_PROMPT.md) to include unity-mcp-skill as a category whose skill files should be updated when features require extra care.
.claude/skills/unity-mcp-skill/SKILL.md
unity-mcp-skill/SKILL.md
tools/UPDATE_DOCS_PROMPT.md

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@Scriptwonder Scriptwonder merged commit d01ac7c into CoplayDev:beta Mar 7, 2026
3 of 4 checks passed
@Scriptwonder Scriptwonder deleted the skill-update branch March 7, 2026 07:46
Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've left some high level feedback:

  • 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.
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.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 7, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 1cf9e381-991a-4c79-b780-ddfa1b21778a

📥 Commits

Reviewing files that changed from the base of the PR and between 70f594e and 8a9f98c.

📒 Files selected for processing (8)
  • .claude/skills/unity-mcp-skill/SKILL.md
  • .claude/skills/unity-mcp-skill/references/tools-reference.md
  • .claude/skills/unity-mcp-skill/references/workflows.md
  • tools/UPDATE_DOCS_PROMPT.md
  • unity-mcp-skill/SKILL.md
  • unity-mcp-skill/references/resources-reference.md
  • unity-mcp-skill/references/tools-reference.md
  • unity-mcp-skill/references/workflows.md

📝 Walkthrough

Walkthrough

This 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

Cohort / File(s) Summary
Camera Tools Documentation
.claude/skills/unity-mcp-skill/references/tools-reference.md, unity-mcp-skill/references/tools-reference.md
Introduces Camera Tools section with manage_camera parameters, action categories (Setup, Creation, Configuration, Extensions, Control, Capture), examples, and tiered capability notes.
Camera Workflows & Resources
.claude/skills/unity-mcp-skill/references/workflows.md, .claude/skills/unity-mcp-skill/references/resources-reference.md, unity-mcp-skill/references/workflows.md, unity-mcp-skill/references/resources-reference.md
Adds Camera & Cinemachine Workflows section with third-person setup, multi-camera blending, and inspection examples; adds Camera Resources category at mcpforunity://scene/cameras with brain, Cinemachine, and Unity camera details.
Quick Start & Skill Documentation
.claude/skills/unity-mcp-skill/SKILL.md, unity-mcp-skill/SKILL.md
Extends Core Tool Categories with Camera row detailing Tier 1/2 capabilities and presets; adds manage_camera example workflows alongside existing manage_gameobject patterns.
ProBuilder & Tool Configuration
.claude/skills/unity-mcp-skill/references/tools-reference.md
Updates manage_probuilder properties parameter type from dict to `dict
Documentation Procedures
tools/UPDATE_DOCS_PROMPT.md
Adds step g) for detecting skill-related features requiring documentation updates to corresponding reference files.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • PR #659: Modifies the same Unity-MCP skill documentation surface (SKILL.md, tools-reference.md, workflows.md, resources-reference.md) with similar documentation structure and patterns.

Poem

🐰 A camera tool now hops into view,
With Cinemachine tricks and workflows too!
Workflows dance and resources gleam,
ProBuilder strings fulfill the dream. ✨

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_camera to the tools reference (parameters, actions, tier behavior, examples).
  • Added a new camera resource entry for mcpforunity://scene/cameras and 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.

Comment on lines +832 to +836
- `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)
Copy link

Copilot AI Mar 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Copilot uses AI. Check for mistakes.

```python
# 1. Check Cinemachine availability
manage_camera(action="ping")
Copy link

Copilot AI Mar 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
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.

Copilot uses AI. Check for mistakes.
Comment on lines +174 to +177
- `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
Copy link

Copilot AI Mar 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
- `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.

Copilot uses AI. Check for mistakes.
Comment on lines +832 to +836
- `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)
Copy link

Copilot AI Mar 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Copilot uses AI. Check for mistakes.

```python
# 1. Check Cinemachine availability
manage_camera(action="ping")
Copy link

Copilot AI Mar 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
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.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants