# Build a Game with AI in Unity — Claude Code + MCP Plugin (Full Walkthrough)

Build a complete Unity game from an empty folder using Claude Code and AI Game Developer — physics, materials, animations, and particles, no manual coding.

_Last updated: 2026-03-24_

What if you could go from an empty folder to a fully playable Unity game — with physics, materials, animations, particles, and controls — without writing a single line of code by hand? In this full walkthrough we do exactly that using Claude Code and the AI Game Developer plugin (Unity-MCP). Multiple AI agents work in parallel to speed up development, and the entire process is driven by voice commands and natural language prompts.

[Video: Build a Game with AI in Unity — Claude Code + MCP Plugin] (https://www.youtube.com/watch?v=xUYV2yxsaLs)

## Setup: From Empty Folder to Connected AI

The entire setup takes just three terminal commands. First, create a new Unity project using the CLI. Then install the AI Game Developer plugin. Finally, open the project in Unity. While Unity loads, you can already launch Claude Code in the project folder and start working.

```bash
# Create a new Unity project
unity-mcp-cli create-project ./MyUnityProject --unity 6000.3.1f1

# Install the AI Game Developer plugin
unity-mcp-cli install-plugin ./MyUnityProject

# Open the project in Unity
unity-mcp-cli open ./MyUnityProject --keep-connected
```

Once the project is open, enable the "Generate Skills" checkbox in the AI Game Developer window. This creates skill files that Claude Code can discover — 57 commands available out of the box. Restart Claude Code after enabling skills so it picks them up. You can verify by typing / in Claude Code and browsing the available commands.

## Skills vs MCP Tools — Why Skills Win

AI Game Developer supports both MCP tools and Claude Code skills. Skills are dramatically more context-efficient: each skill consumes only about 8 tokens of context, while MCP tools consume significantly more. Since AI context is the primary bottleneck — not speed, but intelligence degradation as context fills up — keeping it lean is critical. You can load thousands of skills almost for free.

- Skills: ~8 tokens per skill, loaded on demand, no context overhead
- MCP tools: heavier context footprint, always present in the prompt
- Tip: disable MCP tools you don't need (Gmail, Calendar, etc.) to keep context clean
- Use /clear between tasks to start fresh — never carry stale conversation history

## Building the Scene with Voice Commands

With voice mode enabled in Claude Code (type /voice or hold Space), you can speak your commands naturally. The first task: create three spheres in a line. Claude Code loads the appropriate skills, calls Unity APIs through AI Game Developer, and the spheres appear in the scene within seconds.

### Parallel AI Agents

Here is where it gets powerful. You can open multiple Claude Code terminals in the same project folder, and each one operates as an independent AI agent. While one agent creates gold, silver, and transparent glass materials, another builds a floor with border walls. Both work simultaneously without interfering with each other.

In the walkthrough, we regularly run two or three agents in parallel — one building a WASD rotation controller, another fixing sphere positions, and a third adjusting camera angles. The system handles it gracefully because each agent manages its own context independently.

## AI Self-Correction

Mistakes happen — and that is fine. The AI Game Developer plugin provides detailed error feedback from Unity back to Claude Code, so the AI knows exactly what went wrong and how to fix it. When a tool call fails or a C# script has a compilation error, the agent automatically retries with corrections. You rarely need to intervene.

## Context Management Tips

AI context is the bottleneck — not speed but quality. Once you pass about 50% of the context window, the AI becomes less effective. Here are the key practices demonstrated in the video:

1. Use skills instead of MCP tools — they consume almost no context
2. Run /clear between tasks to reset the conversation
3. Don't carry conversation history from previous tasks
4. Disable unused MCP tools and integrations
5. Use subagents for batch operations — they're much faster than sequential calls
6. Keep each agent focused on one task at a time

## Bypassing Permissions

Claude Code asks for permission each time it wants to execute a tool. For faster iteration, you can ask Claude Code to enable bypass permissions in the project. After restarting Claude Code (Ctrl+C twice, then type claude), it runs without permission prompts. A word of caution: this also means Claude Code will execute any command without confirmation, including potentially harmful ones via prompt injection. Only use this in trusted environments.

## Installing Extensions on the Fly

AI Game Developer has an extension system for specialized capabilities. In the video, we install two extensions mid-session — the AI Particle System package and the AI Animation package — by simply asking Claude Code to do it. Once installed, new skills appear automatically (from 57 to 59+ tools), and you can immediately use them without restarting anything.

- AI Particle System Extension: github.com/IvanMurzak/Unity-AI-ParticleSystem
- AI Animation Extension: github.com/IvanMurzak/Unity-AI-Animation

## Creating Animations and Particles

With the extensions installed, we ask Claude Code to create levitation animations for all decoration objects in the scene — scaling and moving them vertically in an infinite loop. The AI creates animation clips, animator controllers, and wires everything together. When objects snap to the origin due to animation positioning, we fix it by asking the AI to wrap each object in a parent GameObject.

For particles, we ask for a dust particle system. The AI creates it, and when the material appears pink (missing shader), a quick follow-up prompt fixes it. We then ask for brighter, more visible particles and triple the particle count — all through natural language commands.

## The Final Result

The finished game has a rotating floor controlled by WASD keys, three metallic spheres (gold, silver, glass) that roll with realistic physics, colorful decorations levitating with looping animations, and a dust particle system filling the scene with atmosphere. All built from an empty folder using only AI prompts — with minimal context usage (3-5% of the context window per task).

## Works with Any AI Client

While this walkthrough uses Claude Code, AI Game Developer works with any MCP-compatible client — Cursor, Gemini, GitHub Copilot, VS Code, and more. The plugin is completely free and open source. Just connect your preferred AI tool and start building.

## Get Started

Install AI Game Developer, connect Claude Code, and start prompting. Check out the quickstart guide at ai-game.dev/docs/quickstart for step-by-step setup instructions, or grab the download directly from ai-game.dev/download.

- AI Game Developer (Unity-MCP): github.com/IvanMurzak/Unity-MCP
- AI Animation Extension: github.com/IvanMurzak/Unity-AI-Animation
- AI Particle System Extension: github.com/IvanMurzak/Unity-AI-ParticleSystem
- Download: ai-game.dev/download
- Quickstart guide: ai-game.dev/docs/quickstart
- Previous: Connect Claude Code to Unity — ai-game.dev/blog/claude-code-unity-tutorial
- Previous: Generate animations with AI — ai-game.dev/blog/generating-unity-animations-with-ai

---

Source (HTML): https://ai-game.dev/blog/build-game-with-ai-claude-code
