Unreal Agent is an AI-powered editor copilot for Unreal Engine.
It runs inside the editor as a dockable tab, talks to OpenAI’s GPT models, and can inspect and modify your project using Python, scene queries, screenshots, and external tools.
- Engine: Unreal Engine 5.6(current)
- Type: Editor + runtime plugin (
UnrealGPTEditor,UnrealGPT) - Category: Developer Tools
-
In‑editor chat assistant
- Dockable
UnrealGPTtab underWindow → UnrealGPT. Ctrl+Enterto send messages.
- Dockable
-
Scene understanding & context capture
Capture Contextbutton:- Captures a viewport screenshot.
- Streams a JSON scene summary of actors/components in the current level.
scene_querytool to search actors by class/name/label/component types.GetSelectedActorsSummaryfor focused summaries of current selection (used internally).
-
Action‑based agent with Python tooling
python_executetool runs Python editor scripts directly in UE.- Agent is instructed to change the project/level for you, not just give instructions.
- Built‑in reflection helper (
reflection_query) to inspectUClassproperties and functions. - Standard JSON
resultcontract for Python code:status,message, and richdetails(e.g. created actor/asset info).
-
Documentation & web tools
file_searchtool against a UE 5.6 Python API vector store (OpenAIfile_search).web_searchtool to query web docs (OpenAI Responses tools).- Local UE 5.6 Python docs shipped in
ue5_python_api_docs*for reference and indexing.
-
Viewport screenshots & visual feedback
viewport_screenshottool:- Captures the active editor viewport as PNG.
- Shows the screenshot inline in the chat history.
-
Voice input (Whisper)
- Press the microphone button to record from your default input device.
- Audio is sent to OpenAI Whisper (
/v1/audio/transcriptions,whisper-1). - Transcription text is inserted into the chat input for review before sending.
-
Replicate content generation (optional)
- Optional
replicate_generatetool for images, 3D, audio, music, speech, and video. - Direct HTTP integration with Replicate’s Predictions API.
- Python helpers (
Content/Python/unrealgpt_mcp_import.py) to import generated files as:Texture2DStaticMeshSoundWave
- Optional
-
Safety & guardrails
- Tool‑loop protection with a maximum tool‑call iteration count.
- Tool result size limits to avoid blowing up context.
- Execution timeout setting for risky/long‑running Python code.
- Unreal Engine 5.6.0 (plugin
EngineVersionis 5.6.0). - Desktop OS: Developed and tested on Windows; other platforms may work but are not guaranteed.
- Internet access to reach:
- OpenAI API endpoint configured in settings (default:
https://api.openai.com/v1/responses). - Optional Replicate API endpoint (default:
https://api.replicate.com/v1/predictions).
- OpenAI API endpoint configured in settings (default:
- OpenAI‑compatible API key with access to:
- Chosen GPT model (default
gpt-5.1). responsesendpoint.audio/transcriptionsfor Whisper.web_search/file_searchtools if you plan to use them.
- Chosen GPT model (default
- Python editor scripting:
- Enable “Python Editor Script Plugin” (and any dependent Python plugins) in your project/engine.
- A working Python environment that Unreal’s Python plugin can use.
Optional:
- Replicate account + API token if you want to use
replicate_generate.
-
Copy the plugin into your project
- Place this folder as:
YourProject/Plugins/UnrealGPT(recommended), or<UE_5.6_Install>/Engine/Plugins/Developer/UnrealGPT(engine‑wide).
- Place this folder as:
-
Regenerate project files (C++ projects only)
- Right‑click your
.uproject→ Generate Visual Studio project files (or your IDE of choice).
- Right‑click your
-
Open the project in UE5.6
- Launch the editor for your project.
-
Enable the plugin
- Go to Edit → Plugins → Developer Tools (or search for
UnrealGPT). - Enable UnrealGPT.
- Restart the editor if prompted.
- Go to Edit → Plugins → Developer Tools (or search for
-
Enable Python editor scripting
- In Edit → Plugins, enable Python Editor Script Plugin.
- Restart the editor once more if required.
All plugin settings live under:
Edit → Project Settings → Plugins → UnrealGPT
Key settings (UUnrealGPTSettings):
-
API
- Base URL Override
- Optional; overrides only the base URL portion of the API endpoint (e.g. point at a proxy or self‑hosted gateway).
- API Endpoint
- Default:
https://api.openai.com/v1/responses.
- Default:
- API Key
- Your OpenAI (or compatible) API key.
- Used for both chat/responses and Whisper audio transcription.
- Base URL Override
-
Model
- Default Model
- Default:
gpt-5.1. - Any Responses‑capable model is supported; models with native reasoning (e.g.
gpt-5.*,o1,o3) receive additional reasoning configuration automatically.
- Default:
- Default Model
-
Tools
- Enable Python Execution
- Toggle the
python_executetool on/off. - Requires Python editor scripting support in the engine.
- Toggle the
- Enable Viewport Screenshot
- Controls access to
viewport_screenshot(and screenshot capture used byCapture Context).
- Controls access to
- Enable Scene Summary
- Controls
GetSceneSummary/scene_query‑based tools.
- Controls
- Enable Python Execution
-
Replicate (optional)
- Enable Replicate Tool
- Enables
replicate_generatein the tool list.
- Enables
- Replicate API Token
- Token from your Replicate account (the “Token” value, not your password).
- Replicate API URL
- Default:
https://api.replicate.com/v1/predictions.
- Default:
- Image / 3D / SFX / Music / Speech / Video Models
- Default model identifiers per content type.
- Used when the agent doesn’t specify a
versiondirectly.
- Enable Replicate Tool
-
Safety
- Execution Timeout (seconds)
- Upper bound for Python tool execution.
- Max Context Tokens
- Approximate cap on total tokens sent per request (used when building request payloads).
- Execution Timeout (seconds)
-
Context
- Scene Summary Page Size
- Pagination size for world summaries (
GetSceneSummary).
- Pagination size for world summaries (
- Scene Summary Page Size
-
Open the UnrealGPT tab
- In the editor main menu, open Window → UnrealGPT.
- This opens a dockable tab containing the chat UI.
-
Send your first message
- Type into the input box at the bottom:
- Example: “Add three point lights above the player start and align them neatly.”
- Press Ctrl+Enter or click Send.
- Type into the input box at the bottom:
-
Capture context from the current level
- Click “Capture Context” in the top toolbar:
- Sends a scene summary (actors, transforms, components) to the agent.
- Captures a viewport screenshot (if enabled).
- The agent can then reason about what it sees before taking action.
- Click “Capture Context” in the top toolbar:
-
Use voice input (optional)
- Click the microphone icon:
- Recording starts (icon turns red while recording).
- Click again to stop; audio is sent to Whisper and the transcribed text is inserted into the input box.
- Review or edit the transcription, then send as usual.
- Click the microphone icon:
-
Attach images
- Click the paperclip icon to select a local image (
.png,.jpg,.jpeg). - Attached images are base64‑encoded and included with your next message.
- A small label indicates how many images are attached.
- Click the paperclip icon to select a local image (
-
Manage the conversation
- Clear History: Resets the agent’s conversation state and clears the chat UI.
- Reasoning strip:
- A small strip above the input shows brief reasoning or “Thinking…” while the model is working.
- Tool activity
- Tool calls (Python execution, scene queries, screenshots, Replicate, etc.) appear as distinct, color‑coded cards in the history.
- Tool results are summarized in a human‑readable format (e.g. numbered lists for
scene_query).
The plugin configures a set of tools that the model can call autonomously:
-
python_execute- Runs arbitrary Python inside the Unreal Editor process.
- Intended for:
- Creating and modifying actors.
- Working with Blueprints and assets.
- Batch operations in the Content Browser.
- Python code should read/write a shared
resultdictionary (see comments inUnrealGPTAgentClient.cpp). - Supports using helper modules like
unrealgpt_mcp_importto import generated files.
-
scene_query- Searches the world using simple filters:
class_contains,label_contains,name_contains,component_class_contains,max_results.
- Returns a compact JSON array of matches with:
name,label,class, andlocation(x, y, z).
- Searches the world using simple filters:
-
viewport_screenshot- Captures the active viewport and returns a PNG screenshot (base64).
- The UI decodes and displays the screenshot inline.
-
reflection_query- Inspects a
UClassand returns a JSON “schema” for its:- Properties (names, C++/UE types, flags).
- Functions (parameters, return types, flags).
- Helps the model write correct Python against Unreal types.
- Inspects a
-
file_search/web_search(Responses API only)file_searchis configured to use a UE 5.6 Python API vector store.web_searchallows broader web queries (e.g. docs and examples).- Both are native OpenAI tools invoked via the Responses API.
-
replicate_generate(optional)- Available when Replicate Tool is enabled and a Replicate API Token is set.
- Generates content (images, video, audio, or 3D files) via Replicate.
- Returns JSON with:
status,message.details.files[*].local_path,mime_type,inferred_usage.
- Use with
python_executeandunrealgpt_mcp_importto turn files into UE assets.
Note
A “Computer Use” tool is stubbed out in the codebase but currently disabled for safety.
The plugin ships with a Python helper module:
Content/Python/unrealgpt_mcp_import.py
It provides functions the agent (or you) can call from python_execute:
import_mcp_texture(mcp_result_json, target_folder, asset_name_hint=None)- Imports an image file as a
Texture2D.
- Imports an image file as a
import_mcp_static_mesh(mcp_result_json, target_folder, asset_name_hint=None)- Imports a 3D model file as a
StaticMesh.
- Imports a 3D model file as a
import_mcp_audio(mcp_result_json, target_folder, asset_name_hint=None)- Imports an audio file as a
SoundWave.
- Imports an audio file as a
Each helper:
- Parses a result JSON (e.g. from
replicate_generateor MCP), finds the relevant file, - Runs an
AssetImportTask, and - Returns a small JSON dict with:
status,message, anddetails.asset_path/details.local_path.
- Start with “Capture Context” for scene‑related requests so the agent has up‑to‑date information.
- Prefer Python automation:
- Ask for high‑level goals (e.g. “Set up a lighting rig in this level”) and let the agent script it.
- Let the agent verify its work:
- The agent is instructed to use
scene_queryandviewport_screenshotafterpython_executeto confirm success.
- The agent is instructed to use
- Use
file_searchfor API questions:- Ask things like “How do I spawn actors with EditorActorSubsystem in UE 5.6 Python?” and let the agent call
file_searchfirst.
- Ask things like “How do I spawn actors with EditorActorSubsystem in UE 5.6 Python?” and let the agent call
- Keep an eye on Python output:
- If something fails, the
python_executeresult JSON (and any tracebacks) are surfaced in the tool result cards.
- If something fails, the
-
UnrealGPT tab does not appear
- Ensure the plugin is enabled under Edit → Plugins → UnrealGPT.
- Check the Output Log for any module load errors for
UnrealGPTorUnrealGPTEditor.
-
“API Key not set in settings” in log
- Open Project Settings → Plugins → UnrealGPT.
- Set a valid API Key, click Save, then try again.
-
Voice input fails or records silence
- Confirm your system has a default input device and microphones are allowed.
- Check the Output Log for messages from
UnrealGPTVoiceInput.
-
Python execution errors
- Make sure Python Editor Script Plugin is enabled.
- Look for Python tracebacks in tool results or the Output Log.
- If needed, temporarily log more details from your Python scripts.
-
Replicate tool reports configuration errors
- Verify:
- Enable Replicate Tool is checked.
- Replicate API Token is populated.
- Appropriate Image/3D/Audio/etc. model IDs are set.
- Verify:
-
file_search returns errors or no results
file_searchis tied to a specific vector store ID inUnrealGPTAgentClient.cpp.- If your API key does not have access to that store, you can:
- Create your own UE 5.6 Python docs vector store, and
- Update the vector store ID in the source code, then rebuild the plugin.
- Modules:
UnrealGPT(runtime, minimal) – standard module skeleton.UnrealGPTEditor(editor) – UI, agent client, tools, voice input, and settings.
- The chat UI is implemented in
SUnrealGPTWidgetwith a modern AAA‑style layout:- Toolbar (
Capture Context,Clear History,Settings). - Scrollable chat history with message bubbles and tool cards.
- Input row with multiline text, voice button, image attach, and send button.
- Toolbar (
- Fonts:
- Uses the bundled Geist and Geist Mono fonts where available.
- Falls back to standard editor fonts if fonts cannot be loaded from plugin content.
- Author: TREE Industries
- Plugin Name:
UnrealGPT - Description: “AI-powered agent assistant for Unreal Engine 5.6 with code execution and computer use capabilities”