Game Genie is a Unity editor extension that implements Model Context Protocol (MCP) to allow Claude AI to directly edit Unity scenes through a custom editor window. It enables developers to build functional prototypes of games with simple natural language prompts.
- AI-Powered Scene Editing: Describe what you want to create or modify in your scene, and Claude AI will generate the necessary code to make it happen.
- Scene Context Extraction: Automatically extracts the current scene hierarchy, selected objects, components, and project settings to provide context to the AI.
- Code Preview and Execution: Review and execute the generated code directly within the Unity editor.
- Undo Support: All changes made by Game Genie are registered with Unity's Undo system, so you can easily revert them if needed.
- Safety Features: Preview code before execution, error handling, and confirmation dialogs to prevent accidental changes.
- Clone this repository or download the latest release.
- Copy the
Editor/GameGeniefolder into your Unity project'sAssets/Editordirectory. - Open Unity and navigate to
Window > Game Genieto open the Game Genie window.
- Unity 2020.3 or later
- Claude API key (from Anthropic)
- Newtonsoft.Json package (can be installed via the Unity Package Manager)
- Open the Game Genie window from
Window > Game Genie. - Enter your Claude API key in the settings section.
- Type your request in the query field, describing what you want to create or modify in your scene.
- Click "Send to Claude" to generate the code.
- Review the generated code in the preview section.
- Click "Execute Code" to apply the changes to your scene.
- "Create a simple 3D platformer level with platforms, collectibles, and a player character."
- "Add a day-night cycle system to my scene with dynamic lighting."
- "Create a 2D roguelike for mobile with custom characters, maps, enemies, animations and UI."
- "Set up a basic first-person controller with camera movement and jumping."
- "Create a particle system that simulates rain and thunder."
- Game Genie extracts the current scene context, including hierarchy, selected objects, components, and project settings.
- It sends this context along with your query to Claude AI using the Model Context Protocol.
- Claude generates C# code that can be executed within the Unity editor to implement your request.
- Game Genie parses the response, extracts the code blocks, and presents them for review.
- When you execute the code, Game Genie creates a temporary script, compiles it, and runs it within the editor.
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
- Anthropic for the Claude AI model
- Unity Technologies for the Unity game engine