Available now | Open source

Unity Code Agent

The open-source agent harness inside Unity Editor.

Unity Code Agent is an agent designed for long-running autonomous workflows directly inside the Unity Editor.

It works across project files and live game state, using Unity Editor APIs to complete and verify tasks.

Unity Editor and project access

Unity Code Agent edits project files and executes C# with full Unity Editor API access. It can modify scenes, GameObjects, components, assets, settings, serialized values, and object references.

Combined with file editing and verification tools, this access supports work across UI, input, game logic, assets, and runtime behavior.

Tasks the agent can complete

Unity Code Agent can complete focused changes and multi-step features. It can create or update C# code, scenes, prefabs, MonoBehaviours, ScriptableObjects, project configuration, and references, then test and verify the result in the Editor or Play Mode.

Example task

The following task includes:

Create a Snake game. Target resolution: 1920x1080. Grid size: 32x32. The game should fill the screen.
Install TextMesh Pro assets.
Create a 32x32 white PNG sprite and use it for the visuals.
The snake should be light gray with a white head. Food should appear in a random bright color.
Use the new Input System for controls. Create new Input Actions for Up, Down, Left, and Right, bind them to the keyboard arrow keys, and use them.
Show the score at the top center. Show a Game Over screen with the score and allow the player to restart by pressing any key.
The snake should speed up by a configurable percentage after eating food. The amount of length added after eating food should also be configurable.
Follow Unity best practices for game development. Use the MVC pattern.
Verify the work using 'play unity game'. Verification should cover movement, eating food, snake growth, collision detection, scoring, and game-over conditions.

Results depend on model capability, request clarity, and project complexity. Generated changes should be reviewed before they are committed.

Verification in the Editor and Play Mode

Verification runs as part of implementation. The agent evaluates compiler errors, test results, Console messages, runtime values, and Game View output. If a check fails, it can update the implementation and run the check again.

Vision-capable models can analyze captured Game View screenshots. Automated checks can detect broken references, startup exceptions, input regressions, incorrect state transitions, and visible configuration errors. Human playtesting remains responsible for feel, pacing, difficulty, accessibility, and overall quality.

Provider and model selection

Use BYOK with an OpenAI-compatible endpoint with your own API key or GitHub Copilot, including its free and paid subscriptions.

Built-in Unity tools

Built-in tools connect the agent to the active Unity project. The agent can execute C# with full Editor API access, read Console output and project state, run Edit Mode and Play Mode tests, control Play Mode, simulate configured Input System actions, and capture Game View screenshots. These operations support project inspection, implementation, reproduction, and verification.

execute_csharp_script_in_unity_editor
Execute generated C# scripts with full Unity Editor API access and modify scenes, assets, configuration and more.
read_unity_console_logs
Read live Unity Console output from the current project.
run_unity_tests
Run EditMode or PlayMode tests and bring the results back into the agent workflow.
enter_play_mode, exit_play_mode
Move the editor into Play Mode as part of a gameplay automation loop.
play_unity_game
Automate gameplay with input actions so agents can validate in-game behavior.
get_unity_game_view_window_screenshot
Capture the current Game View screenshot.
get_unity_info
Return information about the current Unity Editor project and Agent settings.

Available extensions

The built-in tools cover common Unity implementation and verification work. Additionally, agent capabilities can be improved through three extension points:

Skills
Supply reusable instructions for defined workflows. The package includes skills for Unity Editor scripting and game-playing checks.
Custom tools
Expose project-specific C# operations. Synchronous and asynchronous implementations are discovered and registered automatically.
MCP servers
Connect the agent to local or remote tools and services over stdio, HTTP, or SSE transports.

Unity Code Agent and Unity Code MCP Server

Unity Code Agent includes the agent runtime, Editor chat, sessions, provider configuration, skills, extension points, and Unity tools in one package.

Unity Code MCP Server exposes Unity tools to an external MCP-compatible agent. It complements Unity Code Agent by supporting developers who prefer to keep their existing agent and coding environment.

Latest release

July 2026

Unity Code Agent v0.2 Release Notes

The 0.2 release adds visual Game View inspection, clearer response controls, project-specific sessions, safer C# execution, and stronger Unity workflow guidance.

Requirements

Installation

Install from Unity Package Manager:

  1. Open Window > Package Manager.
  2. Select + > Add package from git URL....
  3. Enter:
https://github.com/Signal-Loop/UnityCodeAgent.git?path=Packages/com.signal-loop.unitycodeagent

Quickstart

Unity Code Agent supports two authentication/provider methods: BYOK and GitHub Copilot (free and paid).

BYOK

  1. Open Tools > UnityCodeAgent > Open Settings.
  2. In BYOK, set BaseUrl to the full HTTPS provider base URL and enter ApiKey. For example, https://openrouter.ai/api/v1 and sk-....
  3. In Model, click Refresh. On first run or after an update, Agent Service code is compiled and started in the background. This may take a few seconds.
  4. Select a model from the dropdown.
  5. Open Tools > UnityCodeAgent > Open Chat.
  6. Try a prompt such as List scene objects.

If no BYOK base URL is set, UnityCodeAgent uses the default GitHub Copilot authentication flow instead.

GitHub Copilot

  1. Sign in to GitHub Copilot on the machine before using the Unity package. Refer to the GitHub Copilot authentication guide for details.
  2. Open Tools > UnityCodeAgent > Open Settings.
  3. Leave BYOK > BaseUrl empty.
  4. In Model, click Refresh. On first run or after an update, Agent Service code is compiled and started in the background. This may take a few seconds.
  5. Select a model from the dropdown.
  6. Open Tools > UnityCodeAgent > Open Chat.
  7. Try a prompt such as List scene objects.

After changing authentication, provider settings, or model settings, use Tools > UnityCodeAgent > Restart Agent Service before refreshing models if the old service process is still running.

Security risks

Unity Code Agent executes AI-generated C# with Unity Editor privileges. Use it at your own risk. To the fullest extent permitted by law, Signal Loop disclaims liability for any changes, damage, or data loss resulting from its use. You are responsible for securing your environment.

Learn more