
How do I generate GDScript with AI?
Three ways: paste code into a chat model, open your .gd files in an AI code editor, or run an agent inside Godot that writes the file and reads the errors it causes. GDScript is a programming language built for Godot , and the third route is what Ziva does.
The three routes differ in what the model can see, not in how well it writes. A script that looks correct in a chat window still fails on the node path it invented, the signal it never connected, or the Godot 3 syntax it learned from an old tutorial. The route that closes that gap is the one that can read the scene and the Output panel after it writes the file.
TL;DR
| Method | Sees your project | Writes the file | Sees Godot errors | Example |
|---|---|---|---|---|
| Chat model in a browser | Only what you paste | No | Only what you paste | ChatGPT, Claude |
| AI code editor or CLI | Text files only | Yes | Only through a terminal or MCP | Cursor, Claude Code |
| Agent inside the editor | Live scene tree, scripts | Yes | Yes | Ziva |
Cursor’s agent and Claude Code both edit files and run terminal commands. They see Godot errors when they launch Godot from a shell or connect to the editor through an MCP server such as Ziva’s, not from the editor’s Output panel by default.
Step by step inside Godot
- Install the plugin. On Linux or macOS run
curl -fsSL https://ziva.sh/install.sh | bash; on Windows runirm https://ziva.sh/install.ps1 | iex(installation guide). Godot 4.2 or later is required. - Sign in. Every new account starts on the free Hobby plan with $3 of included usage a month (docs).
- Open the project and the Ziva dock.
- Point the agent at the right context. Type
@to attach the script or folder you want changed. - Describe the behaviour, not the code. “Make the player dash on Shift for 0.2 seconds with a 1 second cooldown” gives the model the numbers it needs.
- Let it work. The agent reads with
grep_codeand file reads, writes withcreate_fileandedit_file, and checks the tree withget_scene_tree(Godot AI page). - Read the errors it read. Since 3.2.5, a tool result includes the GDScript errors the operation caused, so the agent can see and address them. Godot errors sent to the agent carry the source file and line (3.1.2).
- Ask for a test. Ziva can run your project’s tests and write tests to check its own work (changelog).
- Undo if you dislike the result. Every turn can be undone; the plugin snapshots files before changing them through a Git-backed local history (2.5.0).
The Godot 3 vs Godot 4 syntax trap
Godot 4.0 shipped on 1 March 2023 and renamed core classes. Spatial became Node3D and KinematicBody2D became CharacterBody2D, among many others listed in the official upgrade guide . Models that learned from pre-2023 tutorials can mix the two dialects. Godot forum users report that LLMs “confuse Godot 4 and Godot 3 functions” .
Stale knowledge is not limited to syntax. In our May 2026 study of which Godot AI tools LLMs recommend, cold model knowledge lagged real product capability by 6 to 18 months. And a script that parses can still fail when it runs. Our Claude Godot Code post states the rule: “LLMs cannot debug what they cannot see”. In practice that is a script that compiles, a node path that resolves to null, and a game that crashes on the first frame.
The fix is verification, not a better prompt. An agent that playtests the game and reads the editor output, with each error’s source file and line, can correct a Godot 3 idiom on the next turn. A chat window cannot, so you become the verification loop.
Which model, and what it costs
Model choice matters less than the loop around it, but it still matters. In the GPT-5.6 benchmark, three prompts built a playable Flappy Bird inside a live Godot editor through Ziva:
| Model | Tool calls | Wall time | Build cost | Rubric | Stars |
|---|---|---|---|---|---|
| GPT-5.6 Luna | 26 | 2.4 min | $0.17 | 10/10 | 4/5 |
| GPT-5.6 Terra | 46 | 7.3 min | $1.15 | 10/10 | 4/5 |
| GPT-5.6 Sol | 46 | 6.6 min | $1.59 | 10/10 | 4/5 |
Terra was scored on its xhigh-effort run and priced from a default-effort re-run of 62 tool calls. Each model has one scored run. The parkour benchmark and the vampire-survivor benchmark give each model a single long prompt instead. The vampire-survivor run shows the spread: Claude Opus 5 scored 8 for the world and 9 for the conversation at $65.64, while GPT 5.6 Terra scored 2 and 3 at $2.27.
Inside Ziva the picker starts with three lanes, Genius, Smart and Baby, with the full catalog under Advanced (3.2.5). On Hobby you get 50 Baby messages a day and 10 Smart messages; Genius needs Pro (pricing). The catalog covers hosted models from Anthropic, OpenAI, Google and others, listed on the Godot LLM page. You can also connect a Claude Code or Codex account on any plan, or run Ollama or LM Studio locally at no usage cost.
Prompts that hold up
- Put conventions in an AGENTS.md once: typed GDScript, signal naming, folder layout. Ziva loads it in every chat.
- Name the node path. “The
Playernode underMain” beats “the player”. - Use Plan mode for anything that touches several files. The agent drafts a step-by-step plan for approval before it changes the project (3.0.0).
- Use Ask mode to have the agent explain existing code without changing anything (3.2.5).
- End with “run the tests” or “playtest it and fix what you notice”. The second prompt is the one that separated models in our benchmark. On Pro, the Full Game Playtest Agent takes it further and plays the whole game to a verdict.
C# and inline completion
Ziva writes and refactors C# as well as GDScript (homepage). What it does not do is inline completion as you type: it is a chat agent, and Cursor Tab is the better tool for grayed-out inline completion as you type. If your project is C#-heavy and you type most of it yourself, read GDScript vs C# in Godot and the Cursor comparison before you pick.
Related reading
- Is there an AI copilot inside the Godot editor?: what “inside” buys you
- Is there an AI agent that can playtest a Godot game?: the verification loop taken further
- Claude Godot Code: Why It Beats ChatGPT in 2026: how training cutoffs decide Godot 3 versus Godot 4 output
- How to Use AI with Godot Game Engine: the broader workflow guide