Unity Plugin Skill
First-Time Setup
If unity_execute tool is not available, install the gateway extension:
# From skill directory
./scripts/install-extension.sh
# Restart gateway
openclaw gateway restart
The extension files are in extension/ directory.
Control Unity Editor through 50 built-in tools. Works in both Editor and Play mode.
Quick Reference
Core Tools
| Category |
Key Tools |
| Scene |
scene.getActive, scene.getData, scene.load, scene.open |
| GameObject |
gameobject.find, gameobject.create, gameobject.destroy, gameobject.delete |
| Component |
component.get, component.set, component.add |
| Debug |
debug.hierarchy, debug.screenshot, console.getLogs |
| Input |
input.clickUI, input.type, input.keyPress |
| Editor |
app.play, app.getState, editor.refresh |
Common Workflows
1. Scene Inspection
unity_execute: debug.hierarchy {depth: 2}
unity_execute: scene.getActive
2. Find & Modify Objects
unity_execute: gameobject.find {name: "Player"}
unity_execute: component.get {objectName: "Player", componentType: "Transform"}
unity_execute: transform.setPosition {objectName: "Player", x: 0, y: 5, z: 0}
3. UI Testing
unity_execute: input.clickUI {name: "PlayButton"}
unity_execute: input.type {text: "TestUser", elementName: "UsernameInput"}
unity_execute: debug.screenshot
4. Play Mode Control
unity_execute: app.play {state: true} # Enter Play mode
unity_execute: app.play {state: false} # Exit Play mode
unity_execute: app.getState # Check current state
5. Force Recompile
unity_execute: editor.refresh # Refresh assets & recompile
unity_execute: editor.recompile # Request recompilation only
Tool Categories
Console (3 tools)
console.getLogs - Get logs with optional type filter (Log/Warning/Error)
console.getErrors - Get error/exception logs (with optional warnings)
console.clear - Clear captured logs
Scene (5 tools)
scene.list - List scenes in build settings
scene.getActive - Get active scene info
scene.getData - Get full hierarchy data
scene.load - Load scene by name (Play mode)
scene.open - Open scene in Editor mode (EditorSceneManager)
GameObject (7 tools)
gameobject.find - Find by name, tag, or component
gameobject.create - Create object or primitive (Cube, Sphere, etc.)
gameobject.destroy - Destroy object
gameobject.delete - Delete object (alias for destroy)
gameobject.getData - Get detailed data
gameobject.setActive - Enable/disable
gameobject.setParent - Change hierarchy
Transform (6 tools)
transform.getPosition - Get world position {x, y, z}
transform.getRotation - Get Euler rotation {x, y, z}
transform.getScale - Get local scale {x, y, z}
transform.setPosition - Set world position {x, y, z}
transform.setRotation - Set Euler rotation
transform.setScale - Set local scale
Component (5 tools)
component.add - Add component by type name
component.remove - Remove component
component.get - Get component data/properties
component.set - Set field/property value
component.list - List available component types
Script (3 tools)
script.execute - Execute simple command
script.read - Read script file
script.list - List project scripts
Application (3 tools)
app.getState - Get play mode, FPS, time
app.play - Enter/exit Play mode
app.pause - Toggle pause
Debug (3 tools)
debug.log - Write to console
debug.screenshot - Capture screenshot
debug.hierarchy - Text hierarchy view
Editor (4 tools)
editor.refresh - Refresh AssetDatabase (triggers recompile)
editor.recompile - Request script recompilation
editor.focusWindow - Focus window (game/scene/console/hierarchy/project/inspector)
editor.listWindows - List open windows
Input Simulation (10 tools)
input.keyPress - Press and release key
input.keyDown / input.keyUp - Hold/release key
input.type - Type text into field
input.mouseMove - Move cursor
input.mouseClick - Click at position
input.mouseDrag - Drag operation
input.mouseScroll - Scroll wheel
input.getMousePosition - Get cursor position
input.clickUI - Click UI element by name
Tips
Screenshot Modes
- Play mode:
ScreenCapture - includes all UI overlays
- Editor mode:
Camera.main.Render() - no overlay UI
- Use
{method: "camera"} for camera-only capture
Finding Objects
gameobject.find {name: "Player"} # By exact name
gameobject.find {tag: "Enemy"} # By tag
gameobject.find {componentType: "Camera"} # By component
Script Recompilation
Unity may not auto-recompile after code changes. Use:
editor.refresh # Full asset refresh + recompile
Play Mode Transitions
- Plugin survives Play mode transitions via SessionState
- If connection lost, wait for auto-reconnect or use Window > OpenClaw Plugin > Force Reconnect
Troubleshooting
| Issue |
Solution |
| Tool timeout |
Check Unity is responding, try app.getState |
| No connection |
Verify openclaw unity status, check gateway |
| Scripts not updating |
Use editor.refresh to force recompile |
| Wrong screenshot |
Use Play mode for game view with UI |
Converted and distributed by TomeVault — claim your Tome and manage your conversions.
1---2name: unity-plugin3description: Control Unity Editor via OpenClaw Unity Plugin. Use for Unity game development tasks including scene management, GameObject/Component manipulation, debugging, input simulation, and Play mode control. Triggers on Unity-related requests like inspecting scenes, creating objects, taking screenshots, testing gameplay, or controlling the Editor. Use when this capability is needed.4---56# Unity Plugin Skill78## First-Time Setup910If `unity_execute` tool is not available, install the gateway extension:1112```bash13# From skill directory14./scripts/install-extension.sh1516# Restart gateway17openclaw gateway restart18```1920The extension files are in `extension/` directory.2122Control Unity Editor through 50 built-in tools. Works in both Editor and Play mode.2324## Quick Reference2526### Core Tools2728| Category | Key Tools |29|----------|-----------|30| **Scene** | `scene.getActive`, `scene.getData`, `scene.load`, `scene.open` |31| **GameObject** | `gameobject.find`, `gameobject.create`, `gameobject.destroy`, `gameobject.delete` |32| **Component** | `component.get`, `component.set`, `component.add` |33| **Debug** | `debug.hierarchy`, `debug.screenshot`, `console.getLogs` |34| **Input** | `input.clickUI`, `input.type`, `input.keyPress` |35| **Editor** | `app.play`, `app.getState`, `editor.refresh` |3637## Common Workflows3839### 1. Scene Inspection4041```42unity_execute: debug.hierarchy {depth: 2}43unity_execute: scene.getActive44```4546### 2. Find & Modify Objects4748```49unity_execute: gameobject.find {name: "Player"}50unity_execute: component.get {objectName: "Player", componentType: "Transform"}51unity_execute: transform.setPosition {objectName: "Player", x: 0, y: 5, z: 0}52```5354### 3. UI Testing5556```57unity_execute: input.clickUI {name: "PlayButton"}58unity_execute: input.type {text: "TestUser", elementName: "UsernameInput"}59unity_execute: debug.screenshot60```6162### 4. Play Mode Control6364```65unity_execute: app.play {state: true} # Enter Play mode66unity_execute: app.play {state: false} # Exit Play mode67unity_execute: app.getState # Check current state68```6970### 5. Force Recompile7172```73unity_execute: editor.refresh # Refresh assets & recompile74unity_execute: editor.recompile # Request recompilation only75```7677## Tool Categories7879### Console (3 tools)80- `console.getLogs` - Get logs with optional type filter (Log/Warning/Error)81- `console.getErrors` - Get error/exception logs (with optional warnings)82- `console.clear` - Clear captured logs8384### Scene (5 tools)85- `scene.list` - List scenes in build settings86- `scene.getActive` - Get active scene info87- `scene.getData` - Get full hierarchy data88- `scene.load` - Load scene by name (Play mode)89- `scene.open` - Open scene in Editor mode (EditorSceneManager)9091### GameObject (7 tools)92- `gameobject.find` - Find by name, tag, or component93- `gameobject.create` - Create object or primitive (Cube, Sphere, etc.)94- `gameobject.destroy` - Destroy object95- `gameobject.delete` - Delete object (alias for destroy)96- `gameobject.getData` - Get detailed data97- `gameobject.setActive` - Enable/disable98- `gameobject.setParent` - Change hierarchy99100### Transform (6 tools)101- `transform.getPosition` - Get world position {x, y, z}102- `transform.getRotation` - Get Euler rotation {x, y, z}103- `transform.getScale` - Get local scale {x, y, z}104- `transform.setPosition` - Set world position {x, y, z}105- `transform.setRotation` - Set Euler rotation106- `transform.setScale` - Set local scale107108### Component (5 tools)109- `component.add` - Add component by type name110- `component.remove` - Remove component111- `component.get` - Get component data/properties112- `component.set` - Set field/property value113- `component.list` - List available component types114115### Script (3 tools)116- `script.execute` - Execute simple command117- `script.read` - Read script file118- `script.list` - List project scripts119120### Application (3 tools)121- `app.getState` - Get play mode, FPS, time122- `app.play` - Enter/exit Play mode123- `app.pause` - Toggle pause124125### Debug (3 tools)126- `debug.log` - Write to console127- `debug.screenshot` - Capture screenshot128- `debug.hierarchy` - Text hierarchy view129130### Editor (4 tools)131- `editor.refresh` - Refresh AssetDatabase (triggers recompile)132- `editor.recompile` - Request script recompilation133- `editor.focusWindow` - Focus window (game/scene/console/hierarchy/project/inspector)134- `editor.listWindows` - List open windows135136### Input Simulation (10 tools)137- `input.keyPress` - Press and release key138- `input.keyDown` / `input.keyUp` - Hold/release key139- `input.type` - Type text into field140- `input.mouseMove` - Move cursor141- `input.mouseClick` - Click at position142- `input.mouseDrag` - Drag operation143- `input.mouseScroll` - Scroll wheel144- `input.getMousePosition` - Get cursor position145- `input.clickUI` - Click UI element by name146147## Tips148149### Screenshot Modes150- **Play mode**: `ScreenCapture` - includes all UI overlays151- **Editor mode**: `Camera.main.Render()` - no overlay UI152- Use `{method: "camera"}` for camera-only capture153154### Finding Objects155```156gameobject.find {name: "Player"} # By exact name157gameobject.find {tag: "Enemy"} # By tag158gameobject.find {componentType: "Camera"} # By component159```160161### Script Recompilation162Unity may not auto-recompile after code changes. Use:163```164editor.refresh # Full asset refresh + recompile165```166167### Play Mode Transitions168- Plugin survives Play mode transitions via SessionState169- If connection lost, wait for auto-reconnect or use Window > OpenClaw Plugin > Force Reconnect170171## Troubleshooting172173| Issue | Solution |174|-------|----------|175| Tool timeout | Check Unity is responding, try `app.getState` |176| No connection | Verify `openclaw unity status`, check gateway |177| Scripts not updating | Use `editor.refresh` to force recompile |178| Wrong screenshot | Use Play mode for game view with UI |179180---181> Converted and distributed by [TomeVault](https://tomevault.io/claim/kbarbel640-del) — claim your Tome and manage your conversions.182<!-- tomevault:4.0:skill_md:2026-04-16 -->