--- title: Unity Unreal Code Translator emoji: 🏆 colorFrom: green colorTo: pink sdk: gradio sdk_version: 5.49.0 app_file: app.py pinned: false --- # Unity → Unreal Code Translator # Overview **Unity → Unreal Code Translator** is an AI-assisted developer tool that automatically converts Unity C# scripts into Unreal Engine-ready C++ and Blueprint Python scripts. It's designed to help developers migrate gameplay logic, components, and class structures from Unity to Unreal with minimal manual rewriting. Powered by large language models (Hugging Face or OpenAI), it understands Unity's MonoBehaviour patterns and maps them to equivalent Unreal constructs such as AActor, UCLASS, UPROPERTY, and UFUNCTION. # Key Features **Automatic Code Translation** – Converts Unity C# code to Unreal C++ header/source files and Blueprint Python scripts. **Smart Mapping Rules** – Uses a customizable mapping_table.json to define how Unity APIs map to Unreal equivalents. **Header & Source Separation** – Outputs clean, compile-ready .h and .cpp files using Unreal coding conventions. **Blueprint Generation** – Creates Unreal Python scripts that can build Blueprint actors directly in Unreal Editor. **Downloadable Files** – Exports .h and .cpp files automatically named after your Unity class (e.g., PlayerController.h). **Backend Flexibility** – Choose between Hugging Face (Mistral) or OpenAI (GPT-4o-mini) model backends. **Interactive UI** – Simple, responsive Gradio interface with separate tabs for C++ and Blueprint outputs. # Tech Stack **Frontend**: Gradio (for interactive UI) **Backend**: Python (Fast LLM inference + file generation) **LLM Models**: Hugging Face Mistral-7B-Instruct-v0.3 / OpenAI gpt-4o-mini **Mapping Logic**: JSON-based Unity to Unreal API mapping **File Outputs**: Unreal-style .h, .cpp, and Python script files # How It Works **Parse**: The Unity C# code is analyzed to extract class names, variables, and functions. **Map**: Each Unity API call or type is matched with Unreal equivalents using mapping_table.json. **Synthesize**: A large language model generates the Unreal C++ and Blueprint Python versions. **Split & Save**: The generated output is divided into .h and .cpp sections and made downloadable.