Unity Plugin Skill
Control Unity Editor through 44 built-in tools. Works in both Editor and Play mode.
Quick Reference
Core Tools
| Category |
Key Tools |
| Scene |
scene.getActive, scene.getData, scene.load |
| GameObject |
gameobject.find, gameobject.create, gameobject.destroy |
| 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 (2 tools)
console.getLogs - Get logs with optional type filter (Log/Warning/Error)
console.clear - Clear captured logs
Scene (4 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
GameObject (6 tools)
gameobject.find - Find by name, tag, or component
gameobject.create - Create object or primitive (Cube, Sphere, etc.)
gameobject.destroy - Destroy object
gameobject.getData - Get detailed data
gameobject.setActive - Enable/disable
gameobject.setParent - Change hierarchy
Transform (3 tools)
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 |
Source: TomLeeLive/openclaw-unity-plugin — distributed by TomeVault.
1---2name: unity-plugin-23description: 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 Skill78Control Unity Editor through 44 built-in tools. Works in both Editor and Play mode.910## Quick Reference1112### Core Tools1314| Category | Key Tools |15|----------|-----------|16| **Scene** | `scene.getActive`, `scene.getData`, `scene.load` |17| **GameObject** | `gameobject.find`, `gameobject.create`, `gameobject.destroy` |18| **Component** | `component.get`, `component.set`, `component.add` |19| **Debug** | `debug.hierarchy`, `debug.screenshot`, `console.getLogs` |20| **Input** | `input.clickUI`, `input.type`, `input.keyPress` |21| **Editor** | `app.play`, `app.getState`, `editor.refresh` |2223## Common Workflows2425### 1. Scene Inspection2627```28unity_execute: debug.hierarchy {depth: 2}29unity_execute: scene.getActive30```3132### 2. Find & Modify Objects3334```35unity_execute: gameobject.find {name: "Player"}36unity_execute: component.get {objectName: "Player", componentType: "Transform"}37unity_execute: transform.setPosition {objectName: "Player", x: 0, y: 5, z: 0}38```3940### 3. UI Testing4142```43unity_execute: input.clickUI {name: "PlayButton"}44unity_execute: input.type {text: "TestUser", elementName: "UsernameInput"}45unity_execute: debug.screenshot46```4748### 4. Play Mode Control4950```51unity_execute: app.play {state: true} # Enter Play mode52unity_execute: app.play {state: false} # Exit Play mode53unity_execute: app.getState # Check current state54```5556### 5. Force Recompile5758```59unity_execute: editor.refresh # Refresh assets & recompile60unity_execute: editor.recompile # Request recompilation only61```6263## Tool Categories6465### Console (2 tools)66- `console.getLogs` - Get logs with optional type filter (Log/Warning/Error)67- `console.clear` - Clear captured logs6869### Scene (4 tools)70- `scene.list` - List scenes in build settings71- `scene.getActive` - Get active scene info72- `scene.getData` - Get full hierarchy data73- `scene.load` - Load scene by name7475### GameObject (6 tools)76- `gameobject.find` - Find by name, tag, or component77- `gameobject.create` - Create object or primitive (Cube, Sphere, etc.)78- `gameobject.destroy` - Destroy object79- `gameobject.getData` - Get detailed data80- `gameobject.setActive` - Enable/disable81- `gameobject.setParent` - Change hierarchy8283### Transform (3 tools)84- `transform.setPosition` - Set world position {x, y, z}85- `transform.setRotation` - Set Euler rotation86- `transform.setScale` - Set local scale8788### Component (5 tools)89- `component.add` - Add component by type name90- `component.remove` - Remove component91- `component.get` - Get component data/properties92- `component.set` - Set field/property value93- `component.list` - List available component types9495### Script (3 tools)96- `script.execute` - Execute simple command97- `script.read` - Read script file98- `script.list` - List project scripts99100### Application (3 tools)101- `app.getState` - Get play mode, FPS, time102- `app.play` - Enter/exit Play mode103- `app.pause` - Toggle pause104105### Debug (3 tools)106- `debug.log` - Write to console107- `debug.screenshot` - Capture screenshot108- `debug.hierarchy` - Text hierarchy view109110### Editor (4 tools)111- `editor.refresh` - Refresh AssetDatabase (triggers recompile)112- `editor.recompile` - Request script recompilation113- `editor.focusWindow` - Focus window (game/scene/console/hierarchy/project/inspector)114- `editor.listWindows` - List open windows115116### Input Simulation (10 tools)117- `input.keyPress` - Press and release key118- `input.keyDown` / `input.keyUp` - Hold/release key119- `input.type` - Type text into field120- `input.mouseMove` - Move cursor121- `input.mouseClick` - Click at position122- `input.mouseDrag` - Drag operation123- `input.mouseScroll` - Scroll wheel124- `input.getMousePosition` - Get cursor position125- `input.clickUI` - Click UI element by name126127## Tips128129### Screenshot Modes130- **Play mode**: `ScreenCapture` - includes all UI overlays131- **Editor mode**: `Camera.main.Render()` - no overlay UI132- Use `{method: "camera"}` for camera-only capture133134### Finding Objects135```136gameobject.find {name: "Player"} # By exact name137gameobject.find {tag: "Enemy"} # By tag138gameobject.find {componentType: "Camera"} # By component139```140141### Script Recompilation142Unity may not auto-recompile after code changes. Use:143```144editor.refresh # Full asset refresh + recompile145```146147### Play Mode Transitions148- Plugin survives Play mode transitions via SessionState149- If connection lost, wait for auto-reconnect or use Window > OpenClaw Plugin > Force Reconnect150151## Troubleshooting152153| Issue | Solution |154|-------|----------|155| Tool timeout | Check Unity is responding, try `app.getState` |156| No connection | Verify `openclaw unity status`, check gateway |157| Scripts not updating | Use `editor.refresh` to force recompile |158| Wrong screenshot | Use Play mode for game view with UI |159160---161> Source: [TomLeeLive/openclaw-unity-plugin](https://github.com/TomLeeLive/openclaw-unity-plugin) — distributed by [TomeVault](https://tomevault.io).162<!-- tomevault:4.0:skill_md:2026-06-24 -->