Unity Editor Bridge
Live two-way communication between EngineForge and a running Unity Editor instance via HTTP REST. The bridge enables the AI Agent to create GameObjects, add components, manipulate scenes, and control play mode, all in real-time.
How it works
- When the IDE detects a Unity project, it auto-deploys a compiled plugin to
Assets/Plugins/Editor/EngineForgeBridge.dll - The plugin starts an HTTP server on ports 26742–26752 inside Unity Editor
- The plugin writes a discovery file to
Library/EngineForge/bridge.json with the active port - The IDE polls this file every 5 seconds to find the Unity instance
- Once discovered, all communication happens via HTTP request/response
Why HTTP REST
Unity Editor reloads the C# domain whenever scripts are compiled. WebSocket connections break on every domain reload. HTTP REST is stateless, so each request is independent, so domain reloads don't disrupt the bridge.
Connection status
The Project Panel shows the bridge state. Click the status indicator to trigger a manual reconnection attempt.
- Connected - Commands execute in real-time
- Connecting - Searching for bridge.json
- Disconnected - Unity Editor not running or plugin not loaded
HTTP endpoints
| Method | Path | Purpose |
|---|
| GET | /status | Health check |
| POST | /command | Execute a single command |
| POST | /batch | Execute an array of commands in one frame |
| GET | /events | Drain buffered events (console logs) |
| GET | /capabilities | List all registered tools |
Batch execution
All bridge commands from a single AI response are collected and sent as one POST /batch request. This reduces hundreds of individual HTTP calls to a single request, executing all commands in one Unity editor frame.
Command categories
Scene
| Action | Description |
|---|
getActive | Get the currently open scene name and path |
getHierarchy | Get full scene tree with transforms, components, and canvas info |
create | Create a new blank scene (Camera + Light only) |
open | Open an existing scene file |
save | Save the current scene |
GameObject
| Action | Description |
|---|
create | Create an empty GameObject |
createPrimitive | Create a primitive (Cube, Sphere, Capsule, Cylinder, Plane, Quad) |
find | Find a GameObject by name or path |
destroy | Delete a GameObject |
setActive | Enable or disable a GameObject |
setTransform | Set position, rotation, and scale |
getSelected | Get the currently selected GameObject |
rename | Rename a GameObject |
duplicate | Duplicate a GameObject |
reparent | Move a GameObject to a new parent |
setTagLayer | Set the tag and layer of a GameObject |
Component
| Action | Description |
|---|
add | Add a component to a GameObject |
remove | Remove a component |
getAll | List all components on a GameObject |
setProperty | Set a serialized field or property value |
Prefab
| Action | Description |
|---|
create | Save a GameObject as a prefab |
instantiate | Spawn a prefab instance in the scene |
getAll | List all prefabs in the project |
Script
| Action | Description |
|---|
create | Create a new C# script file |
read | Read the contents of a script |
edit | Edit an existing script |
find | Find a script by name or path |
delete | Delete a script file |
Asset
| Action | Description |
|---|
create | Create an asset (Material, PhysicMaterial) |
find | Find an asset by name or path |
import | Import an external asset file |
createMaterial | Create a new material asset |
setMaterialProperty | Set a property on a material |
getMaterialInfo | Get material properties and shader info |
Project
| Action | Description |
|---|
getProjectInfo | Get project name, version, platform, screen size |
refresh | Refresh the asset database |
addPackage | Add a Unity package by name |
listPackages | List installed packages |
Editor
| Action | Description |
|---|
play | Enter play mode |
stop | Exit play mode |
pause | Pause play mode |
getState | Check editor state (playing, paused, stopped) |
executeMenuItem | Execute a Unity menu item |
getScreenInfo | Get screen resolution and canvas reference data |
Console
| Action | Description |
|---|
getLogs | Retrieve recent console log entries |
clearLogs | Clear the console log buffer |
Screenshot
| Action | Description |
|---|
capture | Capture a screenshot of the game view |
Animation
| Action | Description |
|---|
play | Play an animation |
stop | Stop an animation |
getInfo | Get animation clip info |
setAnimatorParameter | Set an Animator parameter value |
UI
| Action | Description |
|---|
createElement | Create a UI element with canvas setup |
Physics
| Action | Description |
|---|
raycast | Perform a physics raycast |
Lighting
| Action | Description |
|---|
setLighting | Configure scene lighting settings |
getLightingInfo | Get current lighting configuration |
Smart features
Type handling (SmartConvert)
The plugin intelligently converts string values to Unity types:
| Type | Input format |
|---|
| GameObject | Scene path, then asset database lookup |
| Component | Scene path → GetComponent |
| Sprite, Material, AudioClip | Asset path (e.g. “Assets/Sprites/Icon.png”) |
| Enum | Case-insensitive name or integer value |
| Vector2/3/4 | [x,y,z] or (x,y,z) |
| Color | Hex #RRGGBB or RGBA (r,g,b,a) |
Retry on domain reload
If a batch request fails because Unity is reloading the C# domain, the IDE waits up to 60 seconds for reconnection, then re-sends all failed commands.