Capture commands
Commands that render a camera, the Scene View, or a UI Toolkit element to a PNG and return it base64-encoded so an agent can "see" the editor (or a running player) without a display.
capture_game_view
Render a camera to a PNG and return it base64-encoded.
| Parameter | Required | Default | Description |
|---|---|---|---|
width |
no | 1280 |
Output width in px (default 1280; capped 4096). |
height |
no | 720 |
Output height in px (default 720; capped 4096). |
camera |
no | – |
Optional camera name; defaults to Camera.main, else the first enabled camera. |
save_path |
no | – |
Optional project-relative path to also write the PNG (e.g. Screenshots/foo.png). |
Returns: CaptureResult
capture_scene_view
Render the active Scene View to a PNG (base64).
| Parameter | Required | Default | Description |
|---|---|---|---|
width |
no | 1280 |
Output width in px (default 1280; capped 4096). |
height |
no | 720 |
Output height in px (default 720; capped 4096). |
save_path |
no | – |
Optional project-relative path to also write the PNG (e.g. Screenshots/foo.png). |
Returns: CaptureResult
capture_editor_element
Capture a UI Toolkit VisualElement (by selector) from an EditorWindow to a PNG; returns path + base64.
| Parameter | Required | Default | Description |
|---|---|---|---|
window |
yes | – |
EditorWindow type name (e.g. InspectorWindow) or window title to capture from. |
selector |
yes | – |
Element selector: '#name', '.class', a type name (e.g. Button), descendant (space) / child ('>') chains, optional pseudo-states (:checked,:hover,:focus,:active,:enabled,:disabled,:not(...)). |
output |
no | – |
Output PNG path (absolute, or relative to the project root). Defaults to a timestamped file under |
Returns: CaptureElementResponse
Notes: MainThreadRequired = true. Unity 6000.7+ only.
capture_runtime_element
Capture a UI Toolkit VisualElement (by selector) from a live runtime panel (UIDocument or PanelRenderer) to a PNG; returns path + base64.
| Parameter | Required | Default | Description |
|---|---|---|---|
panel |
no | – |
Name of the target panel: matches the PanelSettings asset name or the host GameObject name (UIDocument or PanelRenderer). Optional when exactly one panel exists. |
selector |
yes | – |
Element selector: '#name', '.class', a type name (e.g. Button), descendant (space) / child ('>') chains, optional pseudo-states (:checked,:hover,:focus,:active,:enabled,:disabled,:not(...)). |
output |
no | – |
Output PNG path (absolute, or relative to Application.persistentDataPath). Defaults to a timestamped file under Application.persistentDataPath. |
Returns: CaptureElementResponse
Notes: MainThreadRequired = true, RuntimeOnly. Unity 6000.7+ only.
See Creating commands and Connectivity.