← Platforms

Unity SDK

Remote debugging for Unity: connect any running player to OmniDebugLink and let your AI coding tool traverse the scene, tap the UI and read logs — over the internet, no USB cable.

The Unity SDK is a UPM package (com.omnidebuglink.unity) that attaches to a running Unity player — the editor, a device build, a standalone desktop build or a WebGL build — and bridges it to your AI tool over MCP. The AI can dump the live hierarchy, find objects by name, displayed text or component type, take screenshots, read logs, check performance, click buttons through Unity's real event pipeline, and edit component fields via reflection — no rebuild in the loop.

Core features

Every build target

Editor, device, standalone and WebGL. The bundled transport picks the browser WebSocket (jslib) on WebGL and ClientWebSocket everywhere else.

Single-threaded by design

No background threads: socket events, reconnects and heartbeats are all driven from the main thread, so task handlers can use the Unity API freely.

Deep introspection

Hierarchy dumps that carry live rendered text, per-node component views, and reflection-based field reads and writes — UGUI, NGUI and FairyGUI included.

Real input, not mocks

Clicks are raycast through the EventSystem and delivered as pointerDown/Up/Click on the topmost clickable object — tutorial overlays receive them like a real tap.

Read-only mode

One flag disables every write operation. The read-only state is announced on connect, so the AI knows up front what it may do.

Drop-in WebSocket

The bundled UnityWebSocket copy is renamed at the type, symbol and file level — it will not clash if your project already ships that library.

Requirements

Install (UPM git URL)

In Unity, open Package Manager → Add package from git URL and paste:

https://github.com/omnidebuglink/omnidebuglink_unity.git

To pin a released tag for reproducibility, append it to the URL. Drop the #vX.Y.Z suffix to track main (bleeding edge).

https://github.com/omnidebuglink/omnidebuglink_unity.git#v0.7.0

Wire it up

1

Start the client from your boot scene

One call connects, registers every built-in task, announces capabilities and starts the log buffer. OmniDebugLink.Stop() shuts it down cleanly.

using OmniDebugLink;

public class Boot : MonoBehaviour
{
    void Start()
    {
        OmniDebugLink.Start("<clientToken>");
    }
}
2

Optionally switch to observation-only

Set this before Start for a strict read-only session — every write task is refused while reads, screenshots and logs keep working.

OmniDebugLink.ActionsEnabled = false;  // default is true
3

Add your own tasks if you want to

Register a handler with a name, a short description and a payload schema. Handlers run on the main thread in the player loop, the returned object is serialized back to the AI, and a thrown exception becomes an error result. Any registry change re-announces capabilities automatically — no server-side changes.

OmniDebugLink.Tasks.Register("my_task", handler, description, payloadSchema);

Built-in tasks (21)

Everything below ships in the package and is advertised to the AI on connect. Write tasks are all gated by ActionsEnabled.

Read tasks

TaskWhat it does
scene_traverseFull hierarchy dump (3000-node cap). Nodes that render text carry the live text value — UGUI Text, TextMeshPro, InputField — so the AI reads labels straight from the tree.
find_objectsSearch by node name (substring or regex), displayed text, or component type. Hits carry center coordinates and a click_target (nearest clickable ancestor) that feeds ui_click.
view_componentOne node in depth: UGUI and layout properties, NGUI and FairyGUI dictionaries, plus reflection-based field inspection for anything else.
list_componentList the components attached to a node.
wait_forPoll until a path appears or a component field reaches a value (200 ms interval). Timeouts return found: false instead of an error.
screenshotJPEG capture at end of frame, returned as a native image block; auto-compresses to fit the relay frame budget.
read_logs1000-entry ring buffer of Debug.Log, warnings and exceptions with stack traces, filterable by level, substring, limit and time.
get_perfMono and total memory, GC counts, fps and frame-time percentiles (p50/p95/p99), FrameTiming cpu/gpu times where available, battery.
prefsRead or list PlayerPrefs. The same task also writes and deletes — see below.

Write tasks

TaskWhat it does
ui_clickPhysically delivered: raycasts from the target's center through the EventSystem and runs pointerDown/Up/Click on the topmost clickable object, so overlays and intercept layers see it like a real tap. Locates by path or rendered text (text="Start" clicks the button labelled Start); index disambiguates.
tap_screenTap at normalized 0-1 coordinates (bottom-left origin), through the same raycast pipeline.
swipeDrag between two points over a duration with per-frame deltas, so ScrollRect inertia works.
long_pressPress, hold (default 800 ms) and release without triggering a click.
input_textType into a UGUI InputField or TMP field, firing the change events.
set_componentReflection-based write of any component field.
set_activeToggle a GameObject's active state.
set_time_scaleSet Time.timeScale — slow motion or freeze for inspection.
send_keySoft-dispatch UGUI submit and cancel events (hardware keys cannot be injected in a running player).
prefsWrite and delete PlayerPrefs.

Basics

TaskWhat it does
echo / pingRound-trip checks that the path to your player is alive.
get_statsConnection and runtime statistics for a quick health read.

Good to know