Feedback

unity-plugin

@openclaw Claim

Basic information

Repository
openclaw
Skill
unity-plugin

About unity-plugin

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.

unity-plugin is an agent skill listed in the AddMCP.net directory, published by openclaw. Source code is hosted on github.com.

Overview

What is unity-plugin?


name: unity-plugin version: 1.6.1 description: 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. homepage: https://github.com/TomLeeLive/openclaw-unity-skill author: Tom Jaejoon Lee disableModelInvocation: true


Unity Plugin Skill

Control Unity Editor through ~100 built-in tools. Works in both Editor and Play mode.

unity-plugin tools

Register project-specific tools:

OpenClawCustomTools.Register(
    "mygame.getScore",
    "Get current score",
    (args) => new { success = true, score = GameManager.Score }
);

Connection Modes

1. OpenClaw Gateway (Remote)

For Telegram, Discord, and other OpenClaw channels:

  • Auto-connects when Unity opens
  • Configure in: Window → OpenClaw Plugin → Settings

2. MCP Bridge (Local)

For Claude Code, Cursor, and local AI tools:

  • Start: Window → OpenClaw Plugin → MCP Bridge → Start
  • Default port: 27182
  • Add to Claude Code: claude mcp add unity -- node <path>/MCP~/index.js

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.

What install-extension.sh Does

# 1. Copies extension files from skill to gateway
#    Source: <skill>/extension/
#    Destination: ~/.openclaw/extensions/unity/

# 2. Files installed:
#    - index.ts     # Extension entry point (HTTP handlers, tools)
#    - package.json # Extension metadata

# After installation, restart gateway to load the extension.

🔐 Security

이 스킬은 disableModelInvocation: true로 설정되어 있습니다.

  • AI가 자동으로 도구를 호출하지 않음
  • 사용자가 명시적으로 요청한 작업만 실행

설정 변경 방법은 [README.md](README.md)를 참조하세요.

Quick Reference

Core Tools

| Category | Key Tools | |----------|-----------| | Scene | scene.getActive, scene.getData, scene.load, scene.open, scene.save | | GameObject | gameobject.find, gameobject.getAll, gameobject.create, gameobject.destroy | | Component | component.get, component.set, component.add, component.remove | | Transform | transform.setPosition, transform.setRotation, transform.setScale | | Debug | debug.hierarchy, debug.screenshot, console.getLogs | | Input | input.clickUI, input.type, input.keyPress, input.mouseClick | | Editor | editor.getState, editor.play, editor.stop, editor.refresh | | Material | material.create, material.assign, material.modify, material.getInfo | | Prefab | prefab.create, prefab.instantiate, prefab.open, prefab.save | | Asset | asset.find, asset.copy, asset.move, asset.delete | | Package | package.add, package.remove, package.list, package.search | | Test | test.run, test.list, test.getResults |

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 {name: "Player", componentType: "Transform"}
unity_execute: transform.setPosition {name: "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: editor.play              # Enter Play mode
unity_execute: editor.stop              # Exit Play mode
unity_execute: editor.getState          # Check current state
unity_execute: editor.pause             # Pause
unity_execute: editor.unpause           # Resume

5. Material Creation

unity_execute: material.create {name: "RedMetal", color: "#FF0000", metallic: 0.8}
unity_execute: material.assign {gameObjectName: "Player", materialPath: "Assets/Materials/RedMetal.mat"}
unity_execute: material.modify {path: "Assets/Materials/RedMetal.mat", metallic: 1.0, emission: "#FF4444"}

6. Prefab Workflow

unity_execute: prefab.create {gameObjectName: "Player", path: "Assets/Prefabs/Player.prefab"}
unity_execute: prefab.instantiate {prefabPath: "Assets/Prefabs/Player.prefab", x: 0, y: 1, z: 0}
unity_execute: prefab.open {path: "Assets/Prefabs/Player.prefab"}
unity_execute: prefab.save
unity_execute: prefab.close

7. Asset Management

unity_execute: asset.find {query: "Player", type: "Prefab"}
unity_execute: asset.copy {sourcePath: "Assets/Prefabs/Player.prefab", destPath: "Assets/Backup/Player.prefab"}
unity_execute: asset.move {sourcePath: "Assets/Old/Item.prefab", destPath: "Assets/New/Item.prefab"}

8. Package Management

unity_execute: package.list
unity_execute: package.search {query: "TextMeshPro"}
unity_execute: package.add {packageName: "com.unity.textmeshpro"}
unity_execute: package.add {gitUrl: "https://github.com/example/package.git"}

9. Test Running

unity_execute: test.list {testMode: "EditMode"}
unity_execute: test.run {testMode: "EditMode", filter: "PlayerTests"}
unity_execute: test.getResults

10. Script Execution (Enhanced)

# Debug logging
unity_execute: script.execute {code: "Debug.Log('Hello')"}

# Time manipulation
unity_execute: script.execute {code: "Time.timeScale = 0.5"}

# PlayerPrefs
unity_execute: script.execute {code: "PlayerPrefs.SetInt('score', 100)"}

# Reflection-based method calls
unity_execute: script.execute {code: "MyClass.MyMethod()"}
unity_execute: script.execute {code: "MyClass.MyStaticMethod('param1', 123)"}

MCP Resources - v1.6.0

Access Unity data via MCP resource URIs:

| URI | Description | |-----|-------------| | unity://scene/hierarchy | Scene hierarchy | | unity://scene/active | Active scene info | | unity://project/scripts | Script list | | unity://project/scenes | Scene list | | unity://editor/state | Editor state | | unity://console/logs | Console logs | | unity://session/info | Session info |

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
gameobject.getAll {activeOnly: true}       # All active objects

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 → Settings → Connect

MCP Bridge Usage

For Claude Code / Cursor integration:

  1. Start: Window → OpenClaw Plugin → MCP Bridge → Start
  2. Register: claude mcp add unity -- node /path/to/MCP~/index.js
  3. Verify: curl http://127.0.0.1:27182/status

Input Simulation Limitation

Keyboard/mouse simulation works for UI interactions but NOT for Input.GetKey(). For gameplay testing:

  • Use transform.setPosition to move objects directly
  • Or migrate to Unity's new Input System

Troubleshooting

| Issue | Solution | |-------|----------| | Tool timeout | Check Unity is responding, try editor.getState | | Gateway no connection | Check Window → OpenClaw Plugin → Settings | | MCP no connection | Start MCP Bridge, verify port 27182 | | Scripts not updating | Use editor.refresh to force recompile | | Wrong screenshot | Use Play mode for game view with UI | | MCP 504 timeout | Unity busy or MCP Bridge not started | | Test Runner not found | Install com.unity.test-framework package |

Links

  • Skill Repository: https://github.com/TomLeeLive/openclaw-unity-skill
  • Plugin Repository: https://github.com/TomLeeLive/openclaw-unity-plugin
  • OpenClaw Docs: https://docs.openclaw.ai
  • MCP Setup Guide: See Plugin Repository → Documentation~/SETUP_GUIDE.md

License

MIT License - See LICENSE file

Videos

Tutorials, guides, and showcases related to unity-plugin. The player loads when you press play.

Videos belong to their creators. Relevance is approximate; check the channel and description before following setup steps.

Comments

No comments yet

Be the first to share feedback about this listing. Sign in to leave a comment.

Sign In

Feedback 💬