<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Ziva</title>
    <description>The latest articles on DEV Community by Ziva (@ziva).</description>
    <link>https://dev.to/ziva</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3845272%2F6667c5de-b09a-4a44-b3a4-19819c554824.png</url>
      <title>DEV Community: Ziva</title>
      <link>https://dev.to/ziva</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ziva"/>
    <language>en</language>
    <item>
      <title>Parallel AI agents in Godot: how Ziva's Parallel mode keeps them out of each other's way</title>
      <dc:creator>Ziva</dc:creator>
      <pubDate>Sun, 22 Nov 2026 16:11:13 +0000</pubDate>
      <link>https://dev.to/ziva/parallel-ai-agents-in-godot-how-zivas-parallel-mode-keeps-them-out-of-each-others-way-2f7</link>
      <guid>https://dev.to/ziva/parallel-ai-agents-in-godot-how-zivas-parallel-mode-keeps-them-out-of-each-others-way-2f7</guid>
      <description>&lt;p&gt;Since Ziva 3.3.8 (released November 22, 2026), Ziva can run parallel AI agents on one request in Godot. Pick Parallel mode, describe what you want, and several agents build parts of your game at the same time. Each agent works on its own copy of your project in a background Godot editor, so your editor stays free, and each finished part comes back with a video of Ziva playing it. The same release rebuilds the Playtest Agent on the same idea. Both are on the Pro plan and above.&lt;/p&gt;

&lt;p&gt;Ziva is an AI agent plugin that runs inside the Godot editor. This post is for people who build with coding agents and want to know what happens under the hood.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why each agent gets a copy, not just a branch
&lt;/h2&gt;

&lt;p&gt;Splitting the files between agents is the easy part; git worktrees already do it. Checking the work is harder. An agent that changes a game needs to run that game, and several agents on one project would share one Godot editor, one game window and one set of save files. So each part in Ziva gets its own:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;copy of your project, inside your project's &lt;code&gt;.ziva/parts/&lt;/code&gt; folder&lt;/li&gt;
&lt;li&gt;hidden Godot editor opened on that copy. Copies reuse your import cache, so your assets aren't reimported from scratch.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;user://&lt;/code&gt; folder, so agents can't overwrite your game's save files&lt;/li&gt;
&lt;li&gt;playtests, which run in the background&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What happens when you send a request
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Pick Parallel in the mode picker (click the mode name in the message box).&lt;/li&gt;
&lt;li&gt;Ziva researches first, which can include web searches, and writes down how the game should work under Decided. Every part follows that brief.&lt;/li&gt;
&lt;li&gt;It splits the work into parts, and each part appears as a card in the chat. Agents don't stop to ask you; they only change their own copy until a part is done.&lt;/li&gt;
&lt;li&gt;Each agent builds its part and playtests it. A finished part comes with a video of Ziva playing it, "What changed for the player" and "Checked by playtest". When an existing screen changes, the video shows before and after.&lt;/li&gt;
&lt;li&gt;Finished parts go into your project on their own. If you edited the same file meanwhile, the agent merges both changes and plays it again.&lt;/li&gt;
&lt;li&gt;It ends with a playtest of the whole game.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;While it works, you can steer Ziva from the message box. To watch one agent, click Show editor on its card. You can close that window any time, and the agent keeps working.&lt;/p&gt;

&lt;p&gt;To change or undo a part, open it and click Request changes. There are no Keep or Revert buttons.&lt;/p&gt;

&lt;h2&gt;
  
  
  The rebuilt Playtest Agent
&lt;/h2&gt;

&lt;p&gt;The Playtest Agent now plays in a background Godot editor on a copy of your project, so your editor stays free. Since 3.3.11, one test plays at a time, and further tests wait their turn. It can set up the situation it needs on its copy, such as a test scene or moving the player. In Parallel mode, each part's playtest runs on that part's copy.&lt;/p&gt;

&lt;h2&gt;
  
  
  Platforms
&lt;/h2&gt;

&lt;p&gt;It works on Windows, macOS and Linux. On Linux, Ziva bundles the virtual display (Xvfb) it needs, so there is nothing extra to install.&lt;/p&gt;

&lt;h2&gt;
  
  
  Models and privacy
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;The copies, background editors, games and videos are all processes and files on your computer. The videos stay there.&lt;/li&gt;
&lt;li&gt;The agent that plans the work, its research and the parts all use the model you picked, through the same provider.&lt;/li&gt;
&lt;li&gt;Research can search the web and read pages, and it shows what it searched and read.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Limits
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Godot only, on the Pro plan and above.&lt;/li&gt;
&lt;li&gt;Keep the Godot editor open: the agents need it, and there's no headless or CI mode.&lt;/li&gt;
&lt;li&gt;If Ziva restarts, the turn stops. Send a message to continue.&lt;/li&gt;
&lt;li&gt;Each part needs free disk space of about your project's size plus 1 GB.&lt;/li&gt;
&lt;li&gt;It uses much more usage than a normal chat, because several agents work at once and each one plays its part to check it. Parts have no usage limit of their own.&lt;/li&gt;
&lt;li&gt;Tests are not saved or replayed, so this is not a regression suite. Keep GUT or GdUnit4 in CI.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;

&lt;p&gt;Get the latest Ziva, pick Parallel in the mode picker and describe what you want built.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;How it works: &lt;a href="https://ziva.sh/parallel-ai-agents?utm_source=devto&amp;amp;utm_medium=crosspost&amp;amp;utm_campaign=launch-parallel-agents" rel="noopener noreferrer"&gt;https://ziva.sh/parallel-ai-agents?utm_source=devto&amp;amp;utm_medium=crosspost&amp;amp;utm_campaign=launch-parallel-agents&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Docs: &lt;a href="https://ziva.sh/docs/parallel-mode?utm_source=devto&amp;amp;utm_medium=crosspost&amp;amp;utm_campaign=launch-parallel-agents" rel="noopener noreferrer"&gt;https://ziva.sh/docs/parallel-mode?utm_source=devto&amp;amp;utm_medium=crosspost&amp;amp;utm_campaign=launch-parallel-agents&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Playtest Agent docs: &lt;a href="https://ziva.sh/docs/playtest-agent?utm_source=devto&amp;amp;utm_medium=crosspost&amp;amp;utm_campaign=launch-parallel-agents" rel="noopener noreferrer"&gt;https://ziva.sh/docs/playtest-agent?utm_source=devto&amp;amp;utm_medium=crosspost&amp;amp;utm_campaign=launch-parallel-agents&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Download: &lt;a href="https://ziva.sh/download?utm_source=devto&amp;amp;utm_medium=crosspost&amp;amp;utm_campaign=launch-parallel-agents" rel="noopener noreferrer"&gt;https://ziva.sh/download?utm_source=devto&amp;amp;utm_medium=crosspost&amp;amp;utm_campaign=launch-parallel-agents&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Changelog: &lt;a href="https://ziva.sh/changelog?utm_source=devto&amp;amp;utm_medium=crosspost&amp;amp;utm_campaign=launch-parallel-agents" rel="noopener noreferrer"&gt;https://ziva.sh/changelog?utm_source=devto&amp;amp;utm_medium=crosspost&amp;amp;utm_campaign=launch-parallel-agents&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Bug reports: &lt;a href="https://github.com/ziva-sh/ziva-agent-plugin-godot/issues" rel="noopener noreferrer"&gt;https://github.com/ziva-sh/ziva-agent-plugin-godot/issues&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>godot</category>
      <category>gamedev</category>
      <category>ai</category>
      <category>showdev</category>
    </item>
    <item>
      <title>Godot MCP Setup for Claude Code and Codex (Tested)</title>
      <dc:creator>Ziva</dc:creator>
      <pubDate>Wed, 11 Nov 2026 14:23:34 +0000</pubDate>
      <link>https://dev.to/ziva/godot-mcp-setup-for-claude-code-and-codex-tested-1emk</link>
      <guid>https://dev.to/ziva/godot-mcp-setup-for-claude-code-and-codex-tested-1emk</guid>
      <description>&lt;p&gt;To use Claude Code with Godot, add a Godot MCP server to Claude Code, open your project in Godot and start Claude Code from the project folder. MCP is the bridge that gives the agent tools for your project, such as running the game and reading its errors. With Ziva's MCP server, after installing Ziva and signing in, the Claude Code setup is one button: &lt;strong&gt;Install for Claude Code&lt;/strong&gt; in Ziva's settings (&lt;a href="https://ziva.sh/blogs/use-claude-or-chatgpt-with-godot#1-godot-mcp-for-claude-code-and-codex" rel="noopener noreferrer"&gt;steps in section 1&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;Ziva.sh makes &lt;a href="https://ziva.sh/docs" rel="noopener noreferrer"&gt;Ziva&lt;/a&gt;, a proprietary Godot plugin, publishes this page and ran the tests below.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What we tested.&lt;/strong&gt; On November 11, 2026 we connected Claude Code 2.1.318, with its default model &lt;code&gt;claude-opus-5-5&lt;/code&gt;, to Ziva's MCP server using the exact command that Ziva's &lt;strong&gt;Install for Claude Code&lt;/strong&gt; button runs. We opened the &lt;a href="https://github.com/ziva-sh/ziva-godot-sample" rel="noopener noreferrer"&gt;Star Catcher sample&lt;/a&gt;, whose score never goes up, in Godot 4.7.2 with a development build of Ziva signed in to a free Hobby account, and asked:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;This Godot game's score never goes up when I collect a star. Use the ziva-godot MCP tools to run the game, find the bug, fix it, then run the game again holding the right arrow key to confirm the score changes.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Claude Code ran the game with Ziva's &lt;code&gt;run_scene&lt;/code&gt; while holding the right arrow key. The result held a screenshot still showing "Score: 0" and two script errors, &lt;code&gt;Node not found: "%ScoreLabel"&lt;/code&gt; at &lt;code&gt;main.gd:5&lt;/code&gt; and a null-instance error at &lt;code&gt;main.gd:15&lt;/code&gt;. Claude Code then read the project's scripts and scenes with Ziva's &lt;code&gt;read&lt;/code&gt;, found that &lt;code&gt;ScoreLabel&lt;/code&gt; is a unique name inside &lt;code&gt;hud.tscn&lt;/code&gt;, which &lt;code&gt;main.gd&lt;/code&gt; cannot reach with &lt;code&gt;%ScoreLabel&lt;/code&gt;, and changed one line with Ziva's &lt;code&gt;edit_file&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight diff"&gt;&lt;code&gt;&lt;span class="gd"&gt;-@onready var score_label: Label = %ScoreLabel&lt;/span&gt;
&lt;span class="gi"&gt;+@onready var score_label: Label = $HUD/%ScoreLabel&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Its second &lt;code&gt;run_scene&lt;/code&gt; screenshot showed "Score: 1", and neither script error came back. The run took 37.6 seconds and 12 turns, and Claude Code reported a list-price cost of $0.22 (we used a Claude subscription login). Claude Code's own Read and Edit tools were allowed but unused: every read and the edit went through Ziva.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F25vr6hui8j4sqfn6jfxb.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F25vr6hui8j4sqfn6jfxb.webp" alt="Before the fix: the frame Ziva's run_scene returned to Claude Code after it held the right arrow key in the Star Catcher sample. The first star is gone, two yellow stars remain, the player has moved off screen and the label still reads Score: 0" width="640" height="360"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fnqqdglmgurh97id1295v.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fnqqdglmgurh97id1295v.webp" alt="After Claude Code's one-line fix in main.gd: the frame from Claude Code's second run_scene call, with the teal player square stopped next to where the first star was and the label reading Score: 1" width="640" height="360"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Other results and limits.&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;With the Ziva dock signed out, Ziva's &lt;code&gt;run_scene&lt;/code&gt; still ran the game but returned only "The Run Scene tool failed: Not signed in (no API key on init payload)". Claude Code then told us "The tool failed before the game started", which is wrong: the game ran and logged both errors. This is an open Ziva bug. Sign in to Ziva in its dock before using &lt;code&gt;run_scene&lt;/code&gt;; the free Hobby plan works.&lt;/li&gt;
&lt;li&gt;With Godot closed, Claude Code saw only Ziva's &lt;code&gt;start_godot&lt;/code&gt;, called it and had the editor running 4.1 seconds later. Its first &lt;code&gt;run_scene&lt;/code&gt; after that worked; in an earlier run on November 7, the first one hit a one-off upload error and worked on retry.&lt;/li&gt;
&lt;li&gt;Cursor: on November 10, 2026 we clicked Ziva's &lt;strong&gt;Install for Cursor&lt;/strong&gt;, which wrote &lt;code&gt;ziva-godot&lt;/code&gt; to the project's &lt;code&gt;.cursor/mcp.json&lt;/code&gt;, and ran that file's exact command with our own MCP client. It listed 42 tools, and &lt;code&gt;run_scene&lt;/code&gt; returned a screenshot and the same errors. We did not run Cursor or its agent.&lt;/li&gt;
&lt;li&gt;We ran each Claude Code test once, on Linux, with Claude Code in headless mode (&lt;code&gt;claude -p&lt;/code&gt;). To capture the command, we clicked &lt;strong&gt;Install for Claude Code&lt;/strong&gt; with the &lt;code&gt;claude&lt;/code&gt; command replaced by a logger, then gave Claude Code that command as its only MCP server.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Other routes.&lt;/strong&gt; Coding-Solo's Godot MCP server (free, MIT) works through Godot's command line and project files, with Godot closed. tomyud1's and hi-godot's servers (free, MIT) are live-editor addons that inspect the open editor. You do not need MCP just to edit files or run Godot's command-line checks: Claude Code and Codex can do that from the folder containing &lt;code&gt;project.godot&lt;/code&gt;. For advice only, paste code and scene context into Claude or ChatGPT. To use your existing account inside Ziva instead, see &lt;a href="https://ziva.sh/docs/existing-subscriptions" rel="noopener noreferrer"&gt;https://ziva.sh/docs/existing-subscriptions&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Verify a tool call, not just a saved configuration.&lt;/strong&gt; After setup, ask a live-editor bridge to inspect the current scene and compare its answer with Godot. With Coding-Solo, ask it to run the project and return debug output. A server appearing in a client's list does not by itself prove access to your open editor.&lt;/p&gt;

&lt;p&gt;Other prices and versions checked September 19, 2026. Earlier, on Linux with &lt;a href="https://godotengine.org/article/maintenance-release-godot-4-7-2/" rel="noopener noreferrer"&gt;Godot 4.7.2&lt;/a&gt;, we ran Godot without a window, called MCP tools from scripts and tested both clients' add and list commands. We did not run Claude Desktop, the other servers' AssetLib installs and dock clicks, a Codex session, a Claude Code session with the other servers, the Ziva installer or the account sign-in in section 4; those steps follow documentation. We measured neither productivity nor game quality.&lt;/p&gt;

&lt;h2&gt;
  
  
  TL;DR
&lt;/h2&gt;

&lt;p&gt;MCP costs below cover the bridge; AI-account costs are separate.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Route&lt;/th&gt;
&lt;th&gt;Setup&lt;/th&gt;
&lt;th&gt;What the AI sees&lt;/th&gt;
&lt;th&gt;Runs the game and reads errors&lt;/th&gt;
&lt;th&gt;Cost floor&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;1a. &lt;a href="https://ziva.sh/docs/ziva-mcp-server" rel="noopener noreferrer"&gt;Ziva MCP&lt;/a&gt;
&lt;/td&gt;
&lt;td&gt;Ziva MCP: Settings &amp;gt; Models &amp;amp; Providers &amp;gt; Ziva as an MCP server &amp;gt; Install for your app&lt;/td&gt;
&lt;td&gt;Ziva MCP: open editor, scene tree, files&lt;/td&gt;
&lt;td&gt;Ziva MCP: yes, with input and a game screenshot (dock signed in); tested with Claude Code&lt;/td&gt;
&lt;td&gt;Ziva MCP: free Hobby plan works; AI-provider usage is separate&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;1b. &lt;a href="https://github.com/Coding-Solo/godot-mcp" rel="noopener noreferrer"&gt;Coding-Solo MCP&lt;/a&gt;
&lt;/td&gt;
&lt;td&gt;Coding-Solo MCP: add the server; Node.js 18+&lt;/td&gt;
&lt;td&gt;Coding-Solo MCP: project files&lt;/td&gt;
&lt;td&gt;Coding-Solo MCP: yes, through Godot's command line&lt;/td&gt;
&lt;td&gt;Coding-Solo MCP: Free, MIT&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;1c. Live-editor MCP&lt;/td&gt;
&lt;td&gt;hi-godot/tomyud1 MCP: &lt;a href="https://github.com/hi-godot/godot-ai" rel="noopener noreferrer"&gt;hi-godot addon&lt;/a&gt; or &lt;a href="https://github.com/tomyud1/godot-mcp" rel="noopener noreferrer"&gt;tomyud1 addon&lt;/a&gt;, then add the server&lt;/td&gt;
&lt;td&gt;hi-godot/tomyud1 MCP: open editor&lt;/td&gt;
&lt;td&gt;hi-godot/tomyud1 MCP: &lt;a href="https://github.com/hi-godot/godot-ai/blob/main/docs/TOOLS.md" rel="noopener noreferrer"&gt;yes&lt;/a&gt;
&lt;/td&gt;
&lt;td&gt;hi-godot/tomyud1 MCP: Free, MIT&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2a. Claude Code without MCP&lt;/td&gt;
&lt;td&gt;Claude Code: session in the project folder&lt;/td&gt;
&lt;td&gt;Claude Code: project files&lt;/td&gt;
&lt;td&gt;Claude Code: via &lt;a href="https://docs.godotengine.org/en/latest/tutorials/editor/command_line_tutorial.html" rel="noopener noreferrer"&gt;Godot CLI&lt;/a&gt;
&lt;/td&gt;
&lt;td&gt;Claude Code: Claude Pro $20/month or $17/month billed annually; pay-as-you-go Console API credits&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2b. Codex CLI without MCP&lt;/td&gt;
&lt;td&gt;Codex CLI: session in the project folder&lt;/td&gt;
&lt;td&gt;Codex CLI: project files&lt;/td&gt;
&lt;td&gt;Codex CLI: via Godot CLI&lt;/td&gt;
&lt;td&gt;Codex CLI: &lt;a href="https://learn.chatgpt.com/docs/pricing" rel="noopener noreferrer"&gt;ChatGPT Free&lt;/a&gt; $0, small usage limits&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3. Claude or ChatGPT chat tab&lt;/td&gt;
&lt;td&gt;Claude or ChatGPT chat: paste context&lt;/td&gt;
&lt;td&gt;Claude or ChatGPT chat: what you supply&lt;/td&gt;
&lt;td&gt;Claude or ChatGPT chat: no&lt;/td&gt;
&lt;td&gt;
&lt;a href="https://claude.com/pricing" rel="noopener noreferrer"&gt;Claude Free&lt;/a&gt;, ChatGPT Free: $0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;4. Ziva editor agent with your Claude or ChatGPT account&lt;/td&gt;
&lt;td&gt;Ziva agent: Settings &amp;gt; Models &amp;amp; Providers &amp;gt; Use Existing Subscriptions&lt;/td&gt;
&lt;td&gt;Ziva agent: editor and running game&lt;/td&gt;
&lt;td&gt;Ziva agent: yes&lt;/td&gt;
&lt;td&gt;Ziva agent: every plan, including free Hobby; chat requests use your Claude or ChatGPT plan's limits instead of your Ziva usage&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The &lt;a href="https://docs.google.com/forms/d/e/1FAIpQLSetTdpj9_KESbMNPSJGHkWQZTOHioyXkGgpitgLse-PBZ6c7A/viewanalytics" rel="noopener noreferrer"&gt;Godot Community Poll 2026&lt;/a&gt; (11,195 respondents, multiple answers allowed) asked which tasks AI helps with. Chat help (route 3) drew 42.6%, agentic coding (route 2) 17.9%, and MCP (route 1) 4.9%. The option "I don't use AI, and I'm against it" drew 33.6%.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Godot MCP for Claude Code and Codex
&lt;/h2&gt;

&lt;p&gt;Ziva's MCP server is bundled in the proprietary Ziva plugin and works through the open editor. Coding-Solo, tomyud1 and hi-godot are the GitHub owners of free, MIT servers: Coding-Solo's works with Godot closed, and &lt;a href="https://ziva.sh/blogs/ziva-vs-godot-mcp" rel="noopener noreferrer"&gt;live-editor bridges&lt;/a&gt; inspect the open editor and run scenes there. Claude Code started all three of those servers in our test; Codex only saved configuration.&lt;/p&gt;

&lt;p&gt;For Ziva, install the plugin, open your project and sign in. Installation instructions: &lt;a href="https://ziva.sh/docs/installation" rel="noopener noreferrer"&gt;https://ziva.sh/docs/installation&lt;/a&gt;.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open the project and wait for Ziva to finish starting.&lt;/li&gt;
&lt;li&gt;Open Ziva Settings &amp;gt; Models &amp;amp; Providers &amp;gt; Ziva as an MCP server.&lt;/li&gt;
&lt;li&gt;Confirm Running and a tool count.&lt;/li&gt;
&lt;li&gt;Choose your AI application and select Install for that application. For Claude Code, this runs &lt;code&gt;claude mcp add --scope user ziva-godot -- ...&lt;/code&gt; with Ziva's generated command.&lt;/li&gt;
&lt;li&gt;Restart or reload the client so it discovers &lt;code&gt;ziva-godot&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Open the same project in your client. Ask it to use &lt;code&gt;ziva-godot&lt;/code&gt; to inspect the current scene, then compare the result with Godot before allowing edits.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;For manual setup, select Copy beside your application's generated configuration. It is specific to your computer; do not reuse someone else's command or local URL. These steps follow &lt;a href="https://ziva.sh/docs/ziva-mcp-server" rel="noopener noreferrer"&gt;https://ziva.sh/docs/ziva-mcp-server&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;If a client configured with Ziva's generated command only shows &lt;code&gt;start_godot&lt;/code&gt;, open the target project in Godot or launch your command-line client from the project folder and ask it to start Godot. Start a new client session if the full tool list does not refresh.&lt;/p&gt;

&lt;p&gt;Coding-Solo's and tomyud1's READMEs name their Claude server &lt;code&gt;godot&lt;/code&gt;; the Codex commands below are ours. Use distinct names: adding &lt;code&gt;godot&lt;/code&gt; twice failed in Claude Code and silently overwrote it in Codex.&lt;/p&gt;

&lt;p&gt;For Coding-Solo:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Install Node.js 18+ and npm. Put Godot on PATH or set GODOT_PATH below.&lt;/li&gt;
&lt;li&gt;For Claude Code, run:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   claude mcp add godot -- npx @coding-solo/godot-mcp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or substitute your executable path:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   claude mcp add godot -e &lt;span class="nv"&gt;GODOT_PATH&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;/path/to/godot -e &lt;span class="nv"&gt;DEBUG&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt; -- npx @coding-solo/godot-mcp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;For Codex, run:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   codex mcp add godot -- npx @coding-solo/godot-mcp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or substitute your executable path:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   codex mcp add godot --env &lt;span class="nv"&gt;GODOT_PATH&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;/path/to/godot --env &lt;span class="nv"&gt;DEBUG&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt; -- npx @coding-solo/godot-mcp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A wrong GODOT_PATH silently uses Godot on PATH; DEBUG exposes this.&lt;/p&gt;

&lt;p&gt;For tomyud1:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Install Node.js and &lt;a href="https://godotengine.org/asset-library/asset/4767" rel="noopener noreferrer"&gt;Godot AI Assistant tools MCP, asset 4767&lt;/a&gt;, from AssetLib (Godot's addon browser). The author is tomyud (tomyud1 on GitHub).&lt;/li&gt;
&lt;li&gt;Enable Godot MCP under Project &amp;gt; Project Settings &amp;gt; Plugins.&lt;/li&gt;
&lt;li&gt;For Claude Code, run:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   claude mcp add godot-live -- npx -y godot-mcp-server
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For Codex:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   codex mcp add godot-live -- npx -y godot-mcp-server
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Restart the client, then choose Project &amp;gt; Reload Current Project. Green &lt;code&gt;MCP: Agent Active&lt;/code&gt; confirms connection to Godot; two clients show &lt;code&gt;MCP: Agents (2)&lt;/code&gt;. The README says "MCP Connected".&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Per tomyud1's README, ask the agent to undo with &lt;code&gt;mcp_undo&lt;/code&gt;; Ctrl+Z cannot undo AI edits. After &lt;code&gt;run_scene&lt;/code&gt;, its &lt;code&gt;get_errors&lt;/code&gt; tool returned a runtime error with file and line.&lt;/p&gt;

&lt;p&gt;For hi-godot:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Install uv for &lt;code&gt;uvx&lt;/code&gt;, the Python tool runner its README requires.&lt;/li&gt;
&lt;li&gt;Install &lt;a href="https://godotengine.org/asset-library/asset/5050" rel="noopener noreferrer"&gt;Godot AI, asset 5050, by dlight&lt;/a&gt;. Choose AssetLib's 3.2.1 for Godot 4.5+; its connection and client settings passed on 4.7.2. GitHub's version 4 needs 4.7+.&lt;/li&gt;
&lt;li&gt;Enable it under Project &amp;gt; Project Settings &amp;gt; Plugins; click Configure beside your client in its dock.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;From the project folder:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;claude mcp list
codex mcp list
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://code.claude.com/docs/en/mcp" rel="noopener noreferrer"&gt;&lt;code&gt;claude mcp list&lt;/code&gt;&lt;/a&gt; starts servers added above; &lt;code&gt;✔ Connected&lt;/code&gt; proves startup, not a connection to the open editor. &lt;code&gt;codex mcp list&lt;/code&gt; only lists configuration.&lt;/p&gt;

&lt;p&gt;Check Ziva's Running and tool count or tomyud1's green MCP label. Ask your agent to run hi-godot's &lt;code&gt;project_run&lt;/code&gt;, then &lt;code&gt;logs_read&lt;/code&gt;. For Coding-Solo, request &lt;code&gt;get_debug_output&lt;/code&gt; seconds after &lt;code&gt;run_project&lt;/code&gt;: immediate calls returned nothing; waiting gave errors with file and line.&lt;/p&gt;

&lt;p&gt;For &lt;a href="https://modelcontextprotocol.io/docs/develop/connect-local-servers" rel="noopener noreferrer"&gt;Claude Desktop&lt;/a&gt;, use Ziva's Install or hi-godot's Configure. Otherwise, open Settings &amp;gt; Developer &amp;gt; Edit Config and merge your chosen entry:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;"mcpServers"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;"godot"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nl"&gt;"command"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"npx"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="nl"&gt;"args"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"@coding-solo/godot-mcp"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nl"&gt;"godot-live"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nl"&gt;"command"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"npx"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="nl"&gt;"args"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"-y"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"godot-mcp-server"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;On Windows, replace tomyud1's entry with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="nl"&gt;"godot-live"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;"command"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"cmd"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"args"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"/c"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"npx"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"-y"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"godot-mcp-server"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Save, quit completely, then restart.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Claude Code or Codex in the project folder
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Install &lt;a href="https://code.claude.com/docs/en/quickstart" rel="noopener noreferrer"&gt;Claude Code&lt;/a&gt; or &lt;a href="https://learn.chatgpt.com/docs/codex/cli" rel="noopener noreferrer"&gt;Codex CLI&lt;/a&gt;. Claude Code needs a paid plan, Console account or supported cloud provider; Codex accepts a ChatGPT Free account.&lt;/li&gt;
&lt;li&gt;Create &lt;a href="https://learn.chatgpt.com/docs/agent-configuration/agents-md" rel="noopener noreferrer"&gt;AGENTS.md&lt;/a&gt;, a project-folder instruction file, with your Godot executable location and script-check commands. &lt;a href="https://ziva.sh/docs/agents-md" rel="noopener noreferrer"&gt;Ziva reads AGENTS.md too&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Check &lt;code&gt;claude --version&lt;/code&gt;: &lt;a href="https://code.claude.com/docs/en/memory#agents-md" rel="noopener noreferrer"&gt;AGENTS.md support starts at 2.1.277&lt;/a&gt;. CLAUDE.md, CLAUDE.local.md or .claude/CLAUDE.md here or above stops automatic AGENTS.md loading. Import it with &lt;code&gt;@AGENTS.md&lt;/code&gt; in CLAUDE.md instead. That import also works on older versions, with Bedrock or other cloud providers, or with telemetry disabled.&lt;/li&gt;
&lt;li&gt;Add these checks to AGENTS.md, replacing &lt;code&gt;res://player.gd&lt;/code&gt; with your script. The second runs the main scene, your project's starting scene. Replace &lt;code&gt;godot&lt;/code&gt; with its executable path if needed.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Only &lt;code&gt;timeout 60&lt;/code&gt;, the 60-second limit, is Linux-specific; remove it elsewhere. Godot's &lt;code&gt;--quit-after 60&lt;/code&gt; counts game-loop iterations, not seconds.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   timeout 60 godot --headless --path . --check-only --script res://player.gd
   timeout 60 godot --headless --path . --quit-after 60
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Start Claude Code or Codex where &lt;code&gt;project.godot&lt;/code&gt; lives; see &lt;a href="https://ziva.sh/blogs/claude-code-tips-large-projects" rel="noopener noreferrer"&gt;project workflow tips&lt;/a&gt;. &lt;a href="https://docs.godotengine.org/en/latest/engine_details/file_formats/tscn.html" rel="noopener noreferrer"&gt;TSCN scene files are mostly human-readable text&lt;/a&gt;, so these tools can read scene context.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/godotengine/godot/blob/4.5-stable/editor/settings/editor_settings.cpp#L803" rel="noopener noreferrer"&gt;Auto Reload Scripts on External Change defaults on from 4.5&lt;/a&gt;. In &lt;a href="https://github.com/godotengine/godot/blob/4.4.1-stable/editor/editor_settings.cpp#L714" rel="noopener noreferrer"&gt;4.2 to 4.4.1 it defaults off&lt;/a&gt;: enable it under Editor &amp;gt; Editor Settings &amp;gt; Text Editor &amp;gt; Behavior &amp;gt; Files to see agent edits.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;A parse check does not exercise gameplay. Our test scene printed a null-access error at &lt;code&gt;res://runtime_error.gd:5&lt;/code&gt; but returned exit code 0, so read the output too. The trailing scene path selects our test scene. We trimmed the banner and backtrace; &lt;code&gt;[exit=0]&lt;/code&gt; is the exit code we printed:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ timeout 60 godot --headless --path . --quit-after 60 res://runtime_error.tscn
SCRIPT ERROR: Invalid access to property or key 'name' on a base object of type 'null instance'.
          at: _ready (res://runtime_error.gd:5)
[exit=0]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://code.claude.com/docs/en/permission-modes" rel="noopener noreferrer"&gt;Claude Code starts in auto mode on Pro, Max and Team&lt;/a&gt;, where another model reviews actions. Use &lt;code&gt;claude --permission-mode manual&lt;/code&gt; for prompts before most actions, including edits and commands. To plan, use &lt;code&gt;claude --permission-mode plan&lt;/code&gt;. Codex approvals are not covered here.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.summerengine.com/blog/claude-for-godot" rel="noopener noreferrer"&gt;Summer Engine's Claude guide&lt;/a&gt;, from a competing game-making AI, says Claude Code, Cursor with Claude and the API "cannot press play, watch the running game, and read a live debugger error." Our command runs a game and reads its errors, and through Ziva's MCP server, Claude Code also sent key presses to the running game and read its screenshot in our test above. Inspecting the live debugger remains outside these tests.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://babyloniantwins.com/blog/porting-a-1993-amiga-game-to-godot/" rel="noopener noreferrer"&gt;Rabah Shihab ported his 1993 Amiga game to Godot with Claude Code&lt;/a&gt;. His account describes Claude Code launching games and reading output.&lt;/p&gt;

&lt;p&gt;From Godot 4.4, move companion &lt;a href="https://godotengine.org/article/uid-changes-coming-to-godot-4-4/" rel="noopener noreferrer"&gt;&lt;code&gt;.uid&lt;/code&gt; files&lt;/a&gt; too when moving scripts outside Godot. They preserve resource references. Leaving one behind produced "invalid UID" and "referenced non-existent resource" in our test.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Claude or ChatGPT in a chat tab
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Paste scripts and a screenshot of your node tree (the scene's object hierarchy), &lt;a href="https://www.reddit.com/r/godot/comments/1r6384a/chatgpt_or_claude_for_scripting_support/" rel="noopener noreferrer"&gt;as u/Maximum-Touch-9294 suggests&lt;/a&gt;. They warn you will need to paste scripts repeatedly.&lt;/li&gt;
&lt;li&gt;State your Godot version. &lt;a href="https://www.reddit.com/r/godot/comments/1gnamfl/tips_for_success_using_chatgpt_to_help_with_godot/" rel="noopener noreferrer"&gt;u/OhEvolve reported drift toward Godot 3 syntax&lt;/a&gt;; see &lt;a href="https://ziva.sh/blogs/claude-godot" rel="noopener noreferrer"&gt;which model knows current Godot&lt;/a&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;For editor access, see section 1. ChatGPT in the browser does not read local Codex configuration files. On the same computer, the ChatGPT desktop app, Codex CLI and Codex IDE extension share MCP settings in &lt;code&gt;~/.codex/config.toml&lt;/code&gt;; trusted projects can also use &lt;code&gt;.codex/config.toml&lt;/code&gt;. See &lt;a href="https://developers.openai.com/codex/mcp" rel="noopener noreferrer"&gt;https://developers.openai.com/codex/mcp&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Your Claude or ChatGPT account inside Godot
&lt;/h2&gt;

&lt;p&gt;Sign in to Ziva; &lt;a href="https://ziva.sh/docs/existing-subscriptions" rel="noopener noreferrer"&gt;connect your account&lt;/a&gt;:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open Ziva Settings &amp;gt; Models &amp;amp; Providers &amp;gt; Use Existing Subscriptions.&lt;/li&gt;
&lt;li&gt;Select Connect beside Codex (ChatGPT account) or Claude Code (Anthropic account), then finish browser sign-in.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Use a Claude Pro or Max, or ChatGPT Plus or Pro, account: no API key, and no Claude Code or Codex install. This works on every Ziva plan, including free Hobby (since &lt;a href="https://ziva.sh/changelog" rel="noopener noreferrer"&gt;3.1.2&lt;/a&gt;), and &lt;a href="https://ziva.sh/docs/existing-subscriptions" rel="noopener noreferrer"&gt;chat requests use your Claude or ChatGPT plan's limits instead of your Ziva usage&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Since &lt;a href="https://ziva.sh/changelog" rel="noopener noreferrer"&gt;3.1.2&lt;/a&gt;, agents receive Godot errors with file/line; since &lt;a href="https://ziva.sh/changelog" rel="noopener noreferrer"&gt;3.2.5&lt;/a&gt;, tool results include errors caused by their edits.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://godotengine.org/asset-library/asset/4916" rel="noopener noreferrer"&gt;PurpleJelly's GodotAI, asset 4916&lt;/a&gt;, is proprietary and separate from hi-godot. Its listing offers Claude, ChatGPT, OpenRouter, Ollama and a built-in proxy for Claude Pro or Max subscriptions. Its dock inserts code at your cursor with active-script and scene-tree context.&lt;/p&gt;

&lt;h2&gt;
  
  
  Limits to know
&lt;/h2&gt;

&lt;p&gt;Ziva ships closed-source &lt;a href="https://github.com/ziva-sh/ziva-agent-plugin-godot/releases" rel="noopener noreferrer"&gt;compiled releases&lt;/a&gt;. GitHub's automatic source archives contain the README and support files. Ziva's &lt;a href="https://ziva.sh/terms" rel="noopener noreferrer"&gt;terms&lt;/a&gt; forbid decompiling. Coding-Solo, hi-godot and tomyud1 are MIT-licensed: you can audit or modify their source.&lt;/p&gt;

&lt;p&gt;Ziva needs Godot 4.2 or later and has no inline autocomplete. Your own Claude Pro or Max, or ChatGPT Plus or Pro, subscription works on every plan, including free Hobby, and chat requests use that plan's limits instead of your Ziva usage. For Ziva-hosted model allowances and paid features, check the current offer in your account and &lt;a href="https://ziva.sh/#pricing" rel="noopener noreferrer"&gt;https://ziva.sh/#pricing&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://ziva.sh/privacy" rel="noopener noreferrer"&gt;Ziva never uses your code to train AI models&lt;/a&gt;, and backs up your chats to your account unless you turn that off. Cloud providers process task context under their own retention terms.&lt;/p&gt;

&lt;p&gt;Only connect trusted servers: &lt;a href="https://ziva.sh/docs/mcp-servers" rel="noopener noreferrer"&gt;MCP tools can read or change data&lt;/a&gt;. The &lt;code&gt;npx&lt;/code&gt; command uses Coding-Solo's only npm release, &lt;a href="https://registry.npmjs.org/@coding-solo/godot-mcp" rel="noopener noreferrer"&gt;0.1.1, published February 3, 2026&lt;/a&gt;. It &lt;a href="https://github.com/Coding-Solo/godot-mcp/security/advisories/GHSA-8jx2-rhfh-q928" rel="noopener noreferrer"&gt;fixes command injection through &lt;code&gt;projectPath&lt;/code&gt;&lt;/a&gt; (CVE-2026-25546) in pre-0.1.1 versions, never published to npm.&lt;/p&gt;

&lt;p&gt;Review scene and resource edits. &lt;a href="https://www.reddit.com/r/godot/comments/1s1qph2/how_can_i_integrate_claude_code_into_godot_on/" rel="noopener noreferrer"&gt;u/TripsOverWords warns&lt;/a&gt; that agents can make a mess of these editor-managed files.&lt;/p&gt;

&lt;h2&gt;
  
  
  Related reading
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://ziva.sh/blogs/godot-mcp-server-claude-code-cursor" rel="noopener noreferrer"&gt;Godot MCP server for Claude Code and Cursor&lt;/a&gt;: which servers run the game, send input and take screenshots, with our full test log.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://ziva.sh/blogs/ziva-vs-godot-mcp" rel="noopener noreferrer"&gt;Ziva vs Godot MCP: Plugin Agent or Open-Source Bridge&lt;/a&gt;: five open-source servers compared.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://ziva.sh/blogs/ziva-vs-claude-code-for-godot" rel="noopener noreferrer"&gt;Ziva vs Claude Code for Godot&lt;/a&gt;: terminal or editor.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://ziva.sh/blogs/ziva-vs-chatgpt-for-game-dev" rel="noopener noreferrer"&gt;Ziva vs ChatGPT for Game Development in Godot&lt;/a&gt;: the chat workflow.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://ziva.sh/blogs/claude-godot" rel="noopener noreferrer"&gt;Claude Godot Code: Claude vs GPT-4o on Godot 4 APIs&lt;/a&gt;: model knowledge and version context.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  FAQ
&lt;/h2&gt;

&lt;h3&gt;
  
  
  How do I use Claude Code or ChatGPT with Godot?
&lt;/h3&gt;

&lt;p&gt;Add a Godot MCP server to Claude Code or Codex so the agent can run your game and read its errors, run Claude Code or Codex CLI from your Godot project folder without MCP, paste code into Claude or ChatGPT, or connect your ChatGPT or Claude account inside Ziva. On November 11, 2026, Claude Code connected to Ziva's MCP server ran a sample game, found and fixed its score bug, and confirmed the fix from a screenshot. Choose based on whether you want advice, file edits or access to the open editor.&lt;/p&gt;

&lt;h3&gt;
  
  
  Can ChatGPT connect to the Godot editor?
&lt;/h3&gt;

&lt;p&gt;The ChatGPT desktop app, Codex CLI and Codex IDE extension share local MCP configuration on the same computer. Add a live-editor Godot MCP server through Codex's settings or ~/.codex/config.toml. ChatGPT in the browser does not read that local file.&lt;/p&gt;

&lt;h3&gt;
  
  
  Can Claude Code or Codex run my Godot game and read the errors?
&lt;/h3&gt;

&lt;p&gt;Yes. In our November 11, 2026 test, Claude Code connected to Ziva's MCP server ran a sample game while holding the right arrow key, got a screenshot and both script errors from Ziva's run_scene, fixed the bug with Ziva's edit_file and confirmed Score: 1 in a second run. Ziva's run_scene needs the Ziva dock signed in; signed out, it ran the game but returned only Not signed in. Without MCP, Claude Code and Codex can run Godot's command line from the project folder, but a scene with a runtime script error can still exit with code 0, so read the printed output as well as the exit code.&lt;/p&gt;

&lt;h3&gt;
  
  
  Is there an official Godot AI plugin?
&lt;/h3&gt;

&lt;p&gt;No: Godot AI from hi-godot, asset 5050, is a community submission by dlight under the MIT licence, with Community support rather than Official. Its Asset Library listing serves version 3.2.1 for Godot 4.5 and later, while its GitHub README requires Godot 4.7 or later for version 4.&lt;/p&gt;

&lt;h3&gt;
  
  
  Can I use my Claude or ChatGPT subscription inside the Godot editor?
&lt;/h3&gt;

&lt;p&gt;Yes. Sign in with your Claude Pro or Max, or ChatGPT Plus or Pro, account in Ziva's settings: no API key, and no Claude Code or Codex install. This works on every Ziva plan, including free Hobby, and chat requests use your Claude or ChatGPT plan's limits instead of your Ziva usage. How to connect: &lt;a href="https://ziva.sh/docs/existing-subscriptions" rel="noopener noreferrer"&gt;https://ziva.sh/docs/existing-subscriptions&lt;/a&gt;&lt;/p&gt;

</description>
      <category>godot</category>
      <category>mcp</category>
      <category>claudecode</category>
      <category>chatgpt</category>
    </item>
    <item>
      <title>Why does ChatGPT keep giving me Godot 3 code? We tested 150 answers</title>
      <dc:creator>Ziva</dc:creator>
      <pubDate>Wed, 11 Nov 2026 07:02:54 +0000</pubDate>
      <link>https://dev.to/ziva/why-does-chatgpt-keep-giving-me-godot-3-code-we-tested-150-answers-58b7</link>
      <guid>https://dev.to/ziva/why-does-chatgpt-keep-giving-me-godot-3-code-we-tested-150-answers-58b7</guid>
      <description>&lt;p&gt;ChatGPT gives you Godot 3 code when the model behind it mixes up the two versions. &lt;a href="https://godotengine.org/article/godot-4-0-sets-sail/" rel="noopener noreferrer"&gt;Godot 4.0 shipped on 1 March 2023&lt;/a&gt; and renamed or removed many Godot 3 classes, methods and keywords, so &lt;code&gt;KinematicBody2D&lt;/code&gt;, &lt;code&gt;export var&lt;/code&gt; and &lt;code&gt;yield&lt;/code&gt; no longer work. A current model may not do this anymore: in November 2026 we asked GPT-6 Luna, a current OpenAI model, 10 beginner Godot questions in plain chat, with "Godot 4" in the prompt, without a version, and with web search on. In 150 answers it wrote 0 Godot 3 API errors. What did go wrong was different: a few parse errors, and a few runtime-only bugs that Godot's parser accepts. If you still get Godot 3 code, use a current model, say your Godot version, and check the code in Godot.&lt;/p&gt;

&lt;p&gt;Ziva.sh makes Ziva, an AI agent for Godot, and ran this test. We captured every answer on 10 November 2026 (UTC) and checked the code on Godot 4.7.2. We called GPT-6 Luna through OpenAI's Codex endpoint with a ChatGPT account login, not through the ChatGPT app, which can behave differently. We also ran the same prompts through Ziva on the same model; results are &lt;a href="https://ziva.sh/blogs/chatgpt-godot-3-code#where-ziva-fits" rel="noopener noreferrer"&gt;below&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where the complaints come from
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;In October 2024 a Godot forum user &lt;a href="https://forum.godotengine.org/t/unexpected-identifier-in-class-body-error/50110/6" rel="noopener noreferrer"&gt;posted ChatGPT-written code&lt;/a&gt; with &lt;code&gt;onready var&lt;/code&gt; and &lt;code&gt;self.connect("input_event", self, "_on_input_event")&lt;/code&gt; that failed in Godot 4, and added the next day: &lt;a href="https://forum.godotengine.org/t/unexpected-identifier-in-class-body-error/50110/8" rel="noopener noreferrer"&gt;"Even ChatGPT4.o failed"&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;In September 2025 a forum thread asked whether ChatGPT is a good way to learn Godot. One reply: &lt;a href="https://forum.godotengine.org/t/is-it-bad-to-use-chatgpt-to-help-me-learn-specific-situations-in-godot/121995" rel="noopener noreferrer"&gt;"they confuse Godot 4 and Godot 3 functions"&lt;/a&gt;. Another: "The Godot 3/4 mix up is real".&lt;/li&gt;
&lt;li&gt;In September 2026 a forum user wrote that AI answers &lt;a href="https://forum.godotengine.org/t/adviced-for-a-no-code-exp/143691" rel="noopener noreferrer"&gt;"are mixes from the syntax of Godot3 and Godot4. Even if i explicit say for Godot4.."&lt;/a&gt;, without naming the AI.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Only the first names a specific model version, GPT-4o. We cannot tell which models the others used, and our result says nothing about those models.&lt;/p&gt;

&lt;h2&gt;
  
  
  How we tested
&lt;/h2&gt;

&lt;p&gt;We wrote 10 beginner prompts from forum threads: a 2D platformer player, a third-person controller, spawning enemies on a timer, saving a high score, a Start button that changes scene, fading out a coin, placing tiles from code, a health bar that follows an exported variable, random numbers, and a trap that disappears after 2 seconds. None names an API that changed between Godot 3 and 4. Example: "I'm making my first 2D platformer in Godot 4. Can you write me a player script so my character can run left and right, jump, and fall with gravity?"&lt;/p&gt;

&lt;p&gt;Plain chat got each prompt 3 times per setup, with no project and no system prompt apart from the web-search setup's short instruction to answer from web results. An AI agent read every code block and a script scanned it for a checklist of Godot 3 forms built from the &lt;a href="https://docs.godotengine.org/en/stable/tutorials/migrating/upgrading_to_godot_4.html" rel="noopener noreferrer"&gt;official upgrade guide&lt;/a&gt; and Godot 4.7.2's own upgrade-tool rename map; the same agent did both, and the read was not blind to the scan. Every script also went through Godot 4.7.2's &lt;code&gt;--check-only&lt;/code&gt;. Every runtime error below was confirmed by running the code headless on Godot 4.7.2.&lt;/p&gt;

&lt;h2&gt;
  
  
  Results
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Setup&lt;/th&gt;
&lt;th&gt;Godot 3 API errors&lt;/th&gt;
&lt;th&gt;Other real errors&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;GPT-6 Luna plain chat, prompt says "Godot 4", default reasoning&lt;/td&gt;
&lt;td&gt;GPT-6 Luna plain chat: 0 in 30 answers&lt;/td&gt;
&lt;td&gt;GPT-6 Luna plain chat: 3 answers (2 parse errors, 1 runtime error)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;GPT-6 Luna plain chat, prompt says "Godot 4", low reasoning&lt;/td&gt;
&lt;td&gt;GPT-6 Luna plain chat, low reasoning: 0 in 30&lt;/td&gt;
&lt;td&gt;GPT-6 Luna plain chat, low reasoning: none&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;GPT-6 Luna plain chat, prompt says only "Godot"&lt;/td&gt;
&lt;td&gt;GPT-6 Luna plain chat, no version: 0 in 30&lt;/td&gt;
&lt;td&gt;GPT-6 Luna plain chat, no version: 2 answers (1 runtime error, 1 told to connect a signal StaticBody2D does not have)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;GPT-6 Luna with web search, prompt says "Godot 4"&lt;/td&gt;
&lt;td&gt;GPT-6 Luna with web search: 0 in 30&lt;/td&gt;
&lt;td&gt;GPT-6 Luna with web search: 2 answers (1 runtime error, 1 wrong setup instruction)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;GPT-6 Luna with web search, prompt says only "Godot"&lt;/td&gt;
&lt;td&gt;GPT-6 Luna with web search, no version: 0 in 30&lt;/td&gt;
&lt;td&gt;GPT-6 Luna with web search, no version: 2 answers (both parse errors)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Ziva on GPT-6 Luna, question prompts as above&lt;/td&gt;
&lt;td&gt;Ziva on GPT-6 Luna: 0 in 10 chats&lt;/td&gt;
&lt;td&gt;Ziva on GPT-6 Luna: 2 chats (1 parse error in chat reply code, 1 runtime error)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Ziva on GPT-6 Luna, build-it prompts ("Add the script to my project.")&lt;/td&gt;
&lt;td&gt;Ziva on GPT-6 Luna: 0 in 10 chats&lt;/td&gt;
&lt;td&gt;Ziva on GPT-6 Luna: 1 chat (runtime error)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Ziva on GPT-6 Luna, build-it prompts, only "Godot"&lt;/td&gt;
&lt;td&gt;Ziva on GPT-6 Luna: 0 in 10 chats&lt;/td&gt;
&lt;td&gt;Ziva on GPT-6 Luna: 2 chats (1 runtime error, 1 instruction that breaks the script)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The code used Godot 4 forms throughout: &lt;code&gt;@export&lt;/code&gt;, &lt;code&gt;@onready&lt;/code&gt;, &lt;code&gt;CharacterBody2D&lt;/code&gt; with the &lt;code&gt;velocity&lt;/code&gt; property and &lt;code&gt;move_and_slide()&lt;/code&gt; without arguments, &lt;code&gt;instantiate()&lt;/code&gt;, &lt;code&gt;pressed.connect(...)&lt;/code&gt;, &lt;code&gt;create_tween()&lt;/code&gt;, &lt;code&gt;change_scene_to_file()&lt;/code&gt;, &lt;code&gt;TileMapLayer.set_cell()&lt;/code&gt;, &lt;code&gt;randi_range()&lt;/code&gt; and &lt;code&gt;await ... .timeout&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Without a version in the prompt and without search, 18 of 30 plain-chat answers said they target Godot 4 and the rest named no version; none targeted Godot 3. With web search on, every search GPT-6 Luna ran started with &lt;code&gt;site:docs.godotengine.org/en/stable&lt;/code&gt;, its own choice. Docs pages for Godot 3 or older came back in the search results of 23 of 60 answers, no answer cited one, and none of those answers had Godot 3 code.&lt;/p&gt;

&lt;p&gt;Zero is not proof of never. If every answer were independent, 0 in 150 would put the rate below about 2% with 95% confidence; answers to the same prompt are not independent, so the real uncertainty is larger.&lt;/p&gt;

&lt;h2&gt;
  
  
  What went wrong instead
&lt;/h2&gt;

&lt;p&gt;Seven of the 150 plain-chat answers had code that does not work in Godot 4.7.2: four fail to parse and three parse cleanly and break when they run. Two more gave wrong setup instructions. Three examples.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Turning off an Area2D inside its own signal.&lt;/strong&gt; This line appeared in five places across plain chat and Ziva, in the coin and trap prompts:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight gdscript"&gt;&lt;code&gt;&lt;span class="n"&gt;func&lt;/span&gt; &lt;span class="nf"&gt;_on_body_entered&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;_body&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;Node2D&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;void&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;collected&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;true&lt;/span&gt;
    &lt;span class="n"&gt;monitoring&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;false&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;--check-only&lt;/code&gt; accepts it. When the player touches the coin, Godot 4.7.2 prints this and &lt;code&gt;monitoring&lt;/code&gt; stays &lt;code&gt;true&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ERROR: Function blocked during in/out signal. Use set_deferred("monitoring", true/false).
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Use &lt;code&gt;set_deferred("monitoring", false)&lt;/code&gt;, as several other answers did.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. A setter that touches a node before it exists.&lt;/strong&gt; One web-search answer wrote this health bar script:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight gdscript"&gt;&lt;code&gt;&lt;span class="nd"&gt;@export&lt;/span&gt; &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;health&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;float&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;100.0&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="kt"&gt;set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;health&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;clampf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;0.0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;max_health&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        $&lt;span class="nc"&gt;ProgressBar&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;max_value&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;max_health&lt;/span&gt;
        $&lt;span class="nc"&gt;ProgressBar&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;value&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;health&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It parses. Set Health to 50 in the Inspector and run the scene: the saved value is applied before the &lt;code&gt;ProgressBar&lt;/code&gt; child is added, so the setter fails and the bar shows 0 until health changes again in code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ERROR: Node not found: "ProgressBar" (relative to "Node").
SCRIPT ERROR: Invalid assignment of property or key 'max_value' with value of type 'float' on a base object of type 'null instance'.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Wrap the two &lt;code&gt;$ProgressBar&lt;/code&gt; lines in &lt;code&gt;if is_node_ready():&lt;/code&gt; and update the bar once in &lt;code&gt;_ready()&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. A type Godot cannot infer.&lt;/strong&gt; Four answers failed to parse, three of them on an untyped loop variable in tile-placement code, like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight gdscript"&gt;&lt;code&gt;&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;direction&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nc"&gt;Vector2i&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;UP&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;Vector2i&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;DOWN&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;Vector2i&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;LEFT&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;Vector2i&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;RIGHT&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;neighbor&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="n"&gt;cell&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;direction&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Parse Error: Cannot infer the type of "neighbor" variable because the value doesn't have a set type.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;for direction: Vector2i in [...]&lt;/code&gt; fixes it. Unlike the first two, &lt;code&gt;--check-only&lt;/code&gt; catches this one.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Godot's parser catches, and what it does not
&lt;/h2&gt;

&lt;p&gt;No answer used Godot 3 code, so this list comes from running each Godot 3 form through Godot 4.7.2 ourselves.&lt;/p&gt;

&lt;p&gt;Godot 4.7.2's &lt;code&gt;--check-only&lt;/code&gt; rejects these, so a parse check finds them:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;export var&lt;/code&gt;, &lt;code&gt;onready var&lt;/code&gt;, &lt;code&gt;tool&lt;/code&gt;, &lt;code&gt;setget&lt;/code&gt;, &lt;code&gt;yield&lt;/code&gt; and &lt;code&gt;remote func&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;button.connect("pressed", self, "_on_pressed")&lt;/code&gt;: "Invalid argument for "connect()" function: argument 2 should be "Callable" but is ..."&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;File.new()&lt;/code&gt;, &lt;code&gt;Directory.new()&lt;/code&gt;, &lt;code&gt;OS.get_ticks_msec()&lt;/code&gt;, &lt;code&gt;rand_range()&lt;/code&gt;, &lt;code&gt;update()&lt;/code&gt;, &lt;code&gt;BUTTON_LEFT&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;.empty()&lt;/code&gt; on a typed Array&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;move_and_slide(velocity, Vector2.UP)&lt;/code&gt; and &lt;code&gt;velocity = move_and_slide()&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;classes such as &lt;code&gt;KinematicBody2D&lt;/code&gt;, &lt;code&gt;Spatial&lt;/code&gt;, &lt;code&gt;Position2D&lt;/code&gt; and &lt;code&gt;PoolStringArray&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;rect_position&lt;/code&gt; and &lt;code&gt;translation&lt;/code&gt; on the script's own node&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These pass Godot 4.7.2's &lt;code&gt;--check-only&lt;/code&gt; and fail only when the line runs:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;scene.instance()&lt;/code&gt;: "Invalid call. Nonexistent function 'instance' in base 'PackedScene'."&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;get_tree().change_scene()&lt;/code&gt; and &lt;code&gt;change_scene_to()&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Tween.new()&lt;/code&gt; and the Tween node's &lt;code&gt;interpolate_property()&lt;/code&gt;: "Tween can't be created directly. Use create_tween() method."&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;yield(get_tree(), "idle_frame")&lt;/code&gt; rewritten as &lt;code&gt;await get_tree().idle_frame&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;TileMap &lt;code&gt;set_cellv()&lt;/code&gt; and &lt;code&gt;world_to_map()&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;rect_position&lt;/code&gt; and &lt;code&gt;.empty()&lt;/code&gt; on an untyped variable&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Check AI-written GDScript in one line
&lt;/h2&gt;

&lt;p&gt;Parse and analyze one script without opening the editor:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;godot --headless --path /path/to/your/project --check-only --script res://player.gd
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It prints &lt;code&gt;SCRIPT ERROR: Parse Error: ...&lt;/code&gt; with the line and exits with code 1. A clean script exits with 0. Replace &lt;code&gt;godot&lt;/code&gt; with the path to your Godot 4 executable.&lt;/p&gt;

&lt;p&gt;For the runtime-only list, run the scene. In the editor, press F6 and read the Output and Debugger panels. Headless:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;godot --headless --path /path/to/your/project --quit-after 120 res://main.tscn
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;--quit-after 120&lt;/code&gt; stops after 120 frames. Read the output for &lt;code&gt;SCRIPT ERROR&lt;/code&gt; lines: in our run a scene calling &lt;code&gt;change_scene()&lt;/code&gt; printed "Invalid call. Nonexistent function 'change_scene' in base 'SceneTree'." and Godot still exited with code 0.&lt;/p&gt;

&lt;h2&gt;
  
  
  If you still get Godot 3 code
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Use a current model.&lt;/strong&gt; The complaint above that names a model is about GPT-4o in 2024; GPT-6 Luna wrote none in our test. We did not test older models side by side.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Say your exact version&lt;/strong&gt;, such as "Godot 4.7". It made no difference for GPT-6 Luna, but a chat model cannot see your project.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Check the code in Godot&lt;/strong&gt; with the two commands above before you build on it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Give your agent a rename table.&lt;/strong&gt; Our free, MIT-licensed &lt;a href="https://github.com/ziva-sh/godot-skills" rel="noopener noreferrer"&gt;godot-skills&lt;/a&gt; pack includes a &lt;code&gt;godot-4-api-pitfalls&lt;/code&gt; skill with a Godot 3 to 4 rewrite table and the list of Godot 3 lines that pass &lt;code&gt;--check-only&lt;/code&gt; and fail at runtime. It works with agents that read the Agent Skills format; see &lt;a href="https://ziva.sh/blogs/godot-ai-skills" rel="noopener noreferrer"&gt;Godot AI skills&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Where Ziva fits
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://ziva.sh/" rel="noopener noreferrer"&gt;Ziva&lt;/a&gt; is our AI agent inside the Godot editor. It is proprietary and has a free Hobby plan. We ran the same 10 prompts through Ziva on the same model, GPT-6 Luna, one chat per prompt, in three sets of 10. Ziva also wrote 0 Godot 3 API errors.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Asked a question, Ziva mostly answered in chat.&lt;/strong&gt; With the prompts above ("How do I ...? Please write the script."), Ziva wrote a file in 1 of 10 chats and replied in chat in the other 9. Ziva does not check code in a chat reply.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Asked to build it, Ziva wrote the file and checked it.&lt;/strong&gt; With the same prompts reworded as instructions ("Add the script to my project."), Ziva wrote a &lt;code&gt;.gd&lt;/code&gt; file in all 20 chats. After each write, Ziva's check returned "No problems in this file or its callers." on all 21 writes in the build-it chats.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The check is a parse, not a run.&lt;/strong&gt; It is Godot's GDScript language server plus the editor's script reload, the same kind of check as &lt;code&gt;--check-only&lt;/code&gt;. Two of those files had the &lt;code&gt;monitoring = false&lt;/code&gt; bug from example 1 and still got "No problems". In a separate probe, a script with &lt;code&gt;instance()&lt;/code&gt;, &lt;code&gt;change_scene()&lt;/code&gt;, &lt;code&gt;Tween.new()&lt;/code&gt; and &lt;code&gt;set_cellv()&lt;/code&gt; also got "No problems".&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So this test did not show Ziva's check catching a Godot 3 error, because there were none to catch, and the check cannot see runtime-only errors. Running the scene and reading its output catches those. Ziva can run scenes too, but that was not part of this test.&lt;/p&gt;

&lt;h2&gt;
  
  
  Limits
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;One model, GPT-6 Luna, on one date. Older models, other providers and the ChatGPT app were not tested.&lt;/li&gt;
&lt;li&gt;Plain chat used OpenAI's Codex endpoint, and web search used that endpoint's search tool with instructions to answer from web results. The model searched only the Godot docs, so old forum answers never came up.&lt;/li&gt;
&lt;li&gt;10 prompts that we wrote, 3 answers per prompt in each plain-chat setup and 1 chat per prompt in each Ziva set.&lt;/li&gt;
&lt;li&gt;We added the "add the script to my project" Ziva prompts after seeing that Ziva answered the question prompts in chat, so the two Ziva sets are not a planned comparison. The no-version and web-search sets were also added after the first results, each written down before it ran.&lt;/li&gt;
&lt;li&gt;Ziva ran with low reasoning effort and plain chat with the default; the low-reasoning plain chat set covers that gap. Ziva tells the model the Godot version in its own instructions, so its "only Godot" set still had a version.&lt;/li&gt;
&lt;li&gt;An AI agent, not a person, read the code, and the same agent ran the checklist scan, so the read was not blind to the scan.&lt;/li&gt;
&lt;li&gt;For the build-it Ziva runs we moved the second editor's language-server port, because two Godot editors were open on the test machine and Ziva's check otherwise queried the other editor, as it did for the one file written in the question set. We filed that as a Ziva bug.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Related reading
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://ziva.sh/blogs/claude-godot" rel="noopener noreferrer"&gt;Claude Godot Code: Claude vs GPT-4o on Godot 4 APIs&lt;/a&gt;: training cutoffs and Godot versions&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://ziva.sh/blogs/generate-gdscript-with-ai" rel="noopener noreferrer"&gt;How do I generate GDScript with AI?&lt;/a&gt;: chat, AI code editors and agents inside Godot&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://ziva.sh/blogs/godot-ai-skills" rel="noopener noreferrer"&gt;Godot AI skills&lt;/a&gt;: skill packs for Godot and how to install one&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  FAQ
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Why does ChatGPT keep giving me Godot 3 code when I'm using Godot 4?
&lt;/h3&gt;

&lt;p&gt;Godot 4.0 (March 2023) renamed or removed many Godot 3 classes, methods and keywords, and a model that mixes up the two versions writes code Godot 4 rejects. The forum complaints are real; the one we found that names a specific model version is about GPT-4o, in October 2024. In our November 2026 test, GPT-6 Luna wrote 0 Godot 3 API errors in 150 plain-chat answers to 10 beginner Godot prompts, with Godot 4 in the prompt, without a version, and with web search on. If you still get Godot 3 code, use a current model, say your Godot version, and check the code in Godot.&lt;/p&gt;

&lt;h3&gt;
  
  
  Does it help to write "Godot 4" in the prompt?
&lt;/h3&gt;

&lt;p&gt;Not measurably for GPT-6 Luna in our test: it wrote 0 Godot 3 API errors in 30 answers with Godot 4 in the prompt and 0 in 30 answers that said only Godot. Without a version, 18 of the 30 answers said they target Godot 4 and none targeted Godot 3. Stating the version still costs nothing, and a plain chat model has no other way to know which Godot you use.&lt;/p&gt;

&lt;h3&gt;
  
  
  Does web search make ChatGPT write Godot 3 code?
&lt;/h3&gt;

&lt;p&gt;Not in our test. With web search on, GPT-6 Luna wrote 0 Godot 3 API errors in 60 answers. Every search it ran was restricted to the Godot docs site, and docs pages for Godot 3 or older came back in 23 of the 60 answers, but no answer cited one. We used the search tool on OpenAI's Codex endpoint, not the ChatGPT app, and no forum or Reddit page was ever returned, so this does not test old forum answers.&lt;/p&gt;

&lt;h3&gt;
  
  
  How do I check if AI-written GDScript is valid Godot 4?
&lt;/h3&gt;

&lt;p&gt;Run godot --headless --path /path/to/project --check-only --script res://player.gd with Godot 4. It exits with code 1 and prints Parse Error lines for removed keywords such as export, onready and yield, renamed classes such as KinematicBody2D, and the old connect() form. Some Godot 3 code passes this check and only fails when the line runs, such as instance(), change_scene() and Tween.new(), so also run the scene and read the output.&lt;/p&gt;

&lt;h3&gt;
  
  
  Which Godot 3 code does Godot 4 only catch at runtime?
&lt;/h3&gt;

&lt;p&gt;On Godot 4.7.2 these pass --check-only and fail when the line runs: PackedScene.instance(), get_tree().change_scene() and change_scene_to(), Tween.new() and the Tween node's interpolate_property, the idle_frame signal, TileMap set_cellv and world_to_map, and rect_position or .empty() on an untyped variable.&lt;/p&gt;

&lt;h3&gt;
  
  
  What mistakes did GPT-6 Luna make if not Godot 3 code?
&lt;/h3&gt;

&lt;p&gt;Across 150 plain-chat answers, 4 had parse errors (for example var neighbor := cell + direction, where Godot 4.7.2 cannot infer the type) and 3 had runtime-only bugs that pass the parser: setting monitoring = false inside an Area2D body_entered handler, which Godot blocks, and a health setter that touches $ProgressBar before the node exists. Two more gave wrong setup instructions.&lt;/p&gt;

&lt;h3&gt;
  
  
  Does Ziva stop Godot 3 code?
&lt;/h3&gt;

&lt;p&gt;This test cannot show that. Ziva, running the same GPT-6 Luna model, wrote 0 Godot 3 API errors in 30 chats, so there was nothing for its check to catch. In the build-it chats, its check (Godot's GDScript language server plus the editor's script reload) returned No problems on all 21 writes, including two scripts with a runtime-only bug, because the check parses and analyzes the script without running it.&lt;/p&gt;

&lt;h3&gt;
  
  
  Can I use my own Claude or ChatGPT subscription in Godot?
&lt;/h3&gt;

&lt;p&gt;Yes. Sign in with your Claude Pro or Max, or ChatGPT Plus or Pro, account in Ziva's settings: no API key, and no Claude Code or Codex install. This works on every Ziva plan, including free Hobby, and chat requests use your Claude or ChatGPT plan's limits instead of your Ziva usage. How to connect: &lt;a href="https://ziva.sh/docs/existing-subscriptions" rel="noopener noreferrer"&gt;https://ziva.sh/docs/existing-subscriptions&lt;/a&gt;&lt;/p&gt;

</description>
      <category>godot</category>
      <category>chatgpt</category>
      <category>gdscript</category>
      <category>gamedev</category>
    </item>
    <item>
      <title>How to add collision to a Godot TileMapLayer (and an AI that did it in 2 minutes)</title>
      <dc:creator>Ziva</dc:creator>
      <pubDate>Tue, 10 Nov 2026 03:05:26 +0000</pubDate>
      <link>https://dev.to/ziva/how-to-add-collision-to-a-godot-tilemaplayer-and-an-ai-that-did-it-in-2-minutes-32j9</link>
      <guid>https://dev.to/ziva/how-to-add-collision-to-a-godot-tilemaplayer-and-an-ai-that-did-it-in-2-minutes-32j9</guid>
      <description>&lt;p&gt;This post is the collision section of our full guide, &lt;a href="https://ziva.sh/blogs/godot-tilemap" rel="noopener noreferrer"&gt;Godot TileMapLayer Tutorial: Setup &amp;amp; Example Project&lt;/a&gt;, where you can download the example project used below.&lt;/p&gt;

&lt;h2&gt;
  
  
  Add collision to a TileMapLayer
&lt;/h2&gt;

&lt;p&gt;A TileMapLayer has no collision until its TileSet has a physics layer and the solid tiles have collision polygons. The steps, from the &lt;a href="https://docs.godotengine.org/en/stable/tutorials/2d/using_tilesets.html" rel="noopener noreferrer"&gt;official TileSet tutorial&lt;/a&gt;:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Select the TileMapLayer, click its &lt;strong&gt;TileSet&lt;/strong&gt; property in the inspector, unfold &lt;strong&gt;Physics Layers&lt;/strong&gt; and choose &lt;strong&gt;Add Element&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Open the &lt;strong&gt;TileSet&lt;/strong&gt; editor at the bottom, select a solid tile and open its &lt;strong&gt;Physics Layer 0&lt;/strong&gt; section. Press &lt;strong&gt;F&lt;/strong&gt; for a full-tile rectangle, or draw a polygon.&lt;/li&gt;
&lt;li&gt;Repeat for every solid tile. Tiles without a polygon stay walk-through, which is what you want for water or decoration.&lt;/li&gt;
&lt;li&gt;Leave &lt;strong&gt;Collision Enabled&lt;/strong&gt; on in the layer's inspector, and check that your player's collision mask includes the physics layer's collision layer (both default to layer 1).&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;ChatGPT and older tutorials often describe the deprecated &lt;code&gt;TileMap&lt;/code&gt; node instead. A forum user adding collision put it plainly: "Even ChatGPT cant help me, because he only knows the old TileMap" (&lt;a href="https://forum.godotengine.org/t/tilemaplayer-collisions/85293" rel="noopener noreferrer"&gt;Godot Forum&lt;/a&gt;).&lt;/p&gt;

&lt;h2&gt;
  
  
  Tested: an AI adding collision to this example
&lt;/h2&gt;

&lt;p&gt;We gave &lt;a href="https://ziva.sh/" rel="noopener noreferrer"&gt;Ziva&lt;/a&gt;, an AI agent that runs inside the Godot editor, this page's downloadable example with this request: add collision to the Ground layer so a player can stand on the grass and stone tiles, keep the water tiles non-solid, add a CharacterBody2D player with gravity and arrow-key movement, and check that it lands instead of falling through.&lt;/p&gt;

&lt;p&gt;What it did, from the run's tool log:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Read the TileSet with its TileMapLayer tools: one atlas source with four tiles and no physics layers. It found that &lt;code&gt;demo.gd&lt;/code&gt; paints the cells at runtime, so the saved layer has no tiles.&lt;/li&gt;
&lt;li&gt;Read the tile art to tell grass, stone, water and gold apart, then called its TileSet atlas tool with collision shapes turned on. The tool added the physics layer but skipped the shapes because the tiles already existed, while still reporting success. Ziva caught that by reading the scene file and added 16 x 16 collision polygons to grass and stone only. We have filed that tool behavior as a bug.&lt;/li&gt;
&lt;li&gt;Wrote &lt;code&gt;player.gd&lt;/code&gt; and added the Player node. Godot's GDScript checker reported no problems.&lt;/li&gt;
&lt;li&gt;Ran its physics validator (the player's mask matches the tile layer) and then the scene. The player landed on a tile under the gold marker, so Ziva moved the spawn to plain grass and checked the result in code: resting on the grass, grass and stone with one polygon each, water and gold with none.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F0susk8gac23b1v8q9seg.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F0susk8gac23b1v8q9seg.webp" alt="Ziva's screenshot of the example after the run: the pink player square standing on the grass row." width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It took 2 minutes, 23 tool calls and $0.03 of Ziva usage on Ziva Smart, the default model. Our own check, a separate script run on the result, agreed: the player came to rest on the grass row, with grass and stone solid and water and gold without collision. In this map the water sits below the grass row, so the run shows the water has no collision shape rather than the player falling into it.&lt;/p&gt;

&lt;p&gt;Ziva.sh makes Ziva and wrote this test. We ran it on 10 November 2026 with Godot 4.7.2 on Linux and a development build of Ziva. It is one project and one run, so treat it as an example, not a benchmark.&lt;/p&gt;

&lt;p&gt;For procedural maps the same agent can write the &lt;code&gt;set_cell(coords, source_id, atlas_coords)&lt;/code&gt; loops; every cell is reachable from GDScript. If the player still falls through after this, see our &lt;a href="https://ziva.sh/blogs/godot-collision-not-working" rel="noopener noreferrer"&gt;collision checklist&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;For the art that feeds the TileSet, see our &lt;a href="https://ziva.sh/blogs/pixel-art-tutorial" rel="noopener noreferrer"&gt;pixel art guide&lt;/a&gt;, or &lt;a href="https://ziva.sh/blogs/godot-ai-sprites" rel="noopener noreferrer"&gt;generate tiles with AI inside Godot&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  FAQ
&lt;/h2&gt;

&lt;h3&gt;
  
  
  How do I add collision to a TileMapLayer in Godot 4?
&lt;/h3&gt;

&lt;p&gt;Select the TileMapLayer, edit its TileSet in the inspector, unfold Physics Layers and choose Add Element. Then open the TileSet editor, select each solid tile and draw its collision polygon (press F for a full-tile rectangle). Leave the layer's collision enabled, and make sure your player's collision mask includes the physics layer's collision layer.&lt;/p&gt;

&lt;h3&gt;
  
  
  Can an AI add collision to a Godot TileMapLayer?
&lt;/h3&gt;

&lt;p&gt;We tested Ziva, an AI agent inside the Godot editor, on this page's example project. Asked to make the grass and stone tiles solid and add a player, it added a physics layer and full-tile collision polygons to those two tiles only, wrote the player script, checked the layers with its physics validator and ran the scene. The player landed on the grass. It took 2 minutes and $0.03 of Ziva usage on the default model. One of its TileSet tools silently skipped the collision shapes, and Ziva noticed by reading the scene file.&lt;/p&gt;

</description>
      <category>godot</category>
      <category>gamedev</category>
      <category>ai</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Can AI fix a ChatGPT-made Godot shader? We tested Ziva on a real forum shader</title>
      <dc:creator>Ziva</dc:creator>
      <pubDate>Tue, 10 Nov 2026 03:05:00 +0000</pubDate>
      <link>https://dev.to/ziva/can-ai-fix-a-chatgpt-made-godot-shader-we-tested-ziva-on-a-real-forum-shader-3bpd</link>
      <guid>https://dev.to/ziva/can-ai-fix-a-chatgpt-made-godot-shader-we-tested-ziva-on-a-real-forum-shader-3bpd</guid>
      <description>&lt;p&gt;This post is one section of our full guide, &lt;a href="https://ziva.sh/blogs/godot-shaders" rel="noopener noreferrer"&gt;Godot Shaders in 2026: A Practical Guide to GDShader&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Tested: an AI fixing a ChatGPT-made shader in the editor
&lt;/h2&gt;

&lt;p&gt;A chat assistant can write GDShader, but it cannot compile what it writes. You paste the code into Godot, copy the error back, and repeat. An agent inside the editor can compile each change and look at the running scene. We tested that loop with &lt;a href="https://ziva.sh/" rel="noopener noreferrer"&gt;Ziva&lt;/a&gt; on a real broken shader.&lt;/p&gt;

&lt;p&gt;The shader comes from a &lt;a href="https://forum.godotengine.org/t/need-help-to-fix-my-shader/129338" rel="noopener noreferrer"&gt;Godot forum post&lt;/a&gt; from December 2025 (Godot 4.5). Its author "made the individual parts with the help of ChatGPT" and stitched them into one canvas_item shader: background removal, blur, an overlay texture and color correction. With every module at its default, the sprite came out "much more contrasty" and lost "a lot of brightness". Copied from the forum page, the shader does not even compile, because the forum's formatting dropped some &lt;code&gt;*&lt;/code&gt; signs (&lt;code&gt;6.0d&lt;/code&gt; instead of &lt;code&gt;6.0 * d&lt;/code&gt;).&lt;/p&gt;

&lt;p&gt;We put that exact text in a project, with the Godot icon twice: one plain sprite and one with the shader. Then we asked Ziva, paraphrasing the author's post, to fix it so the defaults leave the image alone and to show both sprites side by side. Here is what it did:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;It listed the broken tokens (&lt;code&gt;6.0d&lt;/code&gt;, &lt;code&gt;c.x6.0&lt;/code&gt;, &lt;code&gt;2.0bo&lt;/code&gt; and more) and sent eight edits at once, most fixing one token each. Every edit was rejected. Ziva compiles a shader after each edit and reverts the edit if Godot reports an error, and the other broken lines were still there. So it rewrote the whole file in one go. That revert is a Ziva bug, and we have filed it.&lt;/li&gt;
&lt;li&gt;The rewrite loaded without errors in the editor but failed when the scene ran, because it had moved &lt;code&gt;TEXTURE&lt;/code&gt; and &lt;code&gt;COLOR&lt;/code&gt; into helper functions, where canvas_item shaders cannot read them. Ziva read the error from the run and passed them in as parameters.&lt;/li&gt;
&lt;li&gt;The next run reproduced the author's problem: the shaded sprite was darker and more contrasty. Ziva built small test scenes to isolate it. A one-line shader, &lt;code&gt;COLOR = texture(TEXTURE, UV);&lt;/code&gt;, matched the original; the matting-only and color-only versions were already dark.&lt;/li&gt;
&lt;li&gt;It checked Godot's shading docs, which say that in &lt;code&gt;fragment()&lt;/code&gt; the input &lt;code&gt;COLOR&lt;/code&gt; is already multiplied by the texture. The stitched shader started with &lt;code&gt;vec4 col = texture(TEXTURE, UV) * COLOR;&lt;/code&gt;, which applies the texture twice. That is the same line a forum member identified by hand.&lt;/li&gt;
&lt;li&gt;Ziva rewrote that line, ran the scene, measured the two sprites with a throwaway pixel check, deleted its 10 debug files and showed the final screenshot.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F5zo5b6bd2xub2tiwqrln.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F5zo5b6bd2xub2tiwqrln.webp" alt="Two screenshots from Ziva's runs. Left: after the compile fix, the shaded sprite is darker than the original. Right: after the COLOR fix, both sprites look the same." width="800" height="237"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It took 12 minutes and 48 tool calls, and used $0.12 of Ziva usage on Ziva Smart, the default model. Our own check, a separate script that rendered the fixed scene, found no pixel difference between the two sprites at the defaults. With contrast, hue, blur or background removal turned up, the shaded sprite changed as expected, so the four modules we tried still worked.&lt;/p&gt;

&lt;p&gt;The fix for anyone with the same symptom is one line. In a canvas_item shader, start from &lt;code&gt;COLOR&lt;/code&gt;, not &lt;code&gt;texture(TEXTURE, UV) * COLOR&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;vec4 col = COLOR; // already texture color * modulate
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Ziva.sh makes Ziva and wrote this test. We ran it on 10 November 2026 with Godot 4.7.2 on Linux and a development build of Ziva. It is one shader and one run, so treat it as an example, not a benchmark.&lt;/p&gt;

&lt;p&gt;Without that loop, you are pasting code into ChatGPT and copying error messages back. The forum author spent "quite a while" trying to make the stitched ChatGPT code run without errors before asking for help.&lt;/p&gt;

&lt;p&gt;For a broader survey of AI tools in the Godot pipeline, see &lt;a href="https://ziva.sh/blogs/best-ai-tools-for-godot-game-engine" rel="noopener noreferrer"&gt;Best AI Tools &amp;amp; Plugins for Godot Game Engine&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  FAQ
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Can AI write and fix Godot shaders?
&lt;/h3&gt;

&lt;p&gt;It can write GDShader, but a chat assistant cannot compile what it writes, so you find the errors yourself. An agent inside the Godot editor can compile each change and look at the result. We tested Ziva on a shader from the Godot forum that its author had built with ChatGPT: it fixed the compile errors, found why the sprite came out darker, and showed both sprites side by side. Our own pixel check found them identical. It took 12 minutes and $0.12 of Ziva usage on the default model.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why does my Godot canvas_item shader make the sprite darker?
&lt;/h3&gt;

&lt;p&gt;A common cause is texture(TEXTURE, UV) * COLOR in fragment(). In a canvas_item shader, COLOR already holds the texture color multiplied by the vertex color, so multiplying by the texture again applies it twice. Use COLOR on its own, or texture(TEXTURE, UV) without the extra COLOR, unless you need the modulate color.&lt;/p&gt;

</description>
      <category>godot</category>
      <category>ai</category>
      <category>gamedev</category>
      <category>shaders</category>
    </item>
    <item>
      <title>Godot collision not working? A tested checklist, and an AI that finds the cause</title>
      <dc:creator>Ziva</dc:creator>
      <pubDate>Tue, 10 Nov 2026 03:04:34 +0000</pubDate>
      <link>https://dev.to/ziva/godot-collision-not-working-a-tested-checklist-and-an-ai-that-finds-the-cause-d2k</link>
      <guid>https://dev.to/ziva/godot-collision-not-working-a-tested-checklist-and-an-ai-that-finds-the-cause-d2k</guid>
      <description>&lt;p&gt;If your Area2D's &lt;code&gt;body_entered&lt;/code&gt; never fires, or your player falls straight through the floor, check the seven settings below. We tested the Area2D ones in Godot 4.7.2 and reproduced the floor one in an example project. If you would rather have an AI find it: &lt;a href="https://ziva.sh/" rel="noopener noreferrer"&gt;Ziva&lt;/a&gt;, an AI agent inside the Godot editor, found and fixed all four bugs in a deliberately broken scene in 1 minute 34 seconds, using its &lt;code&gt;validate_physics_setup&lt;/code&gt; tool and by reading the scene. That test is further down, along with the broken project to download.&lt;/p&gt;

&lt;h2&gt;
  
  
  The checklist
&lt;/h2&gt;

&lt;p&gt;Work down the list. Each item has its fix in one line.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;#&lt;/th&gt;
&lt;th&gt;Cause&lt;/th&gt;
&lt;th&gt;Fix&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;The Area2D's &lt;strong&gt;Mask&lt;/strong&gt; does not include the body's layer&lt;/td&gt;
&lt;td&gt;Tick the body's layer under Collision &amp;gt; Mask on the Area2D&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;The CollisionShape2D has no &lt;strong&gt;Shape&lt;/strong&gt;, or it is Disabled&lt;/td&gt;
&lt;td&gt;Set Shape to a new RectangleShape2D (or similar) and untick Disabled&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;Monitoring&lt;/strong&gt; is off on the Area2D&lt;/td&gt;
&lt;td&gt;Tick Monitoring in the Area2D's inspector&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;The signal is not connected, or connected to the wrong node&lt;/td&gt;
&lt;td&gt;Connect &lt;code&gt;body_entered&lt;/code&gt; to the node whose script has the method&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;5&lt;/td&gt;
&lt;td&gt;You listen to &lt;code&gt;area_entered&lt;/code&gt; for a body&lt;/td&gt;
&lt;td&gt;Use &lt;code&gt;body_entered&lt;/code&gt; for bodies, &lt;code&gt;area_entered&lt;/code&gt; for other Area2Ds&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;6&lt;/td&gt;
&lt;td&gt;A CharacterBody2D falls through the floor&lt;/td&gt;
&lt;td&gt;Tick the floor's layer under Collision &amp;gt; Mask on the character&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;7&lt;/td&gt;
&lt;td&gt;The floor is a TileMapLayer with no physics layer&lt;/td&gt;
&lt;td&gt;Add a physics layer to its TileSet and draw collision polygons on the solid tiles&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;How we tested items 1 to 5: a headless Godot 4.7.2 script dropped a CharacterBody2D on collision layer 2 through an Area2D with a 60 x 60 rectangle shape, moving it 4 pixels per physics frame with &lt;code&gt;move_and_slide()&lt;/code&gt;, and recorded whether the signal fired. A working setup fired; every broken variant in items 1 to 5 did not.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Collision layers and masks: the Area2D's mask is what matters
&lt;/h3&gt;

&lt;p&gt;Godot's &lt;a href="https://docs.godotengine.org/en/stable/tutorials/physics/physics_introduction.html#collision-layers-and-masks" rel="noopener noreferrer"&gt;physics introduction&lt;/a&gt; defines the two properties. The layer "describes the layers that the object appears in". The mask "describes what layers the body will scan for collisions. If an object isn't in one of the mask layers, the body will ignore it." Both default to layer 1.&lt;/p&gt;

&lt;p&gt;For an Area2D to report a body, the &lt;strong&gt;body's layer&lt;/strong&gt; must be in the &lt;strong&gt;Area2D's mask&lt;/strong&gt;. In our test, an Area2D with mask 1 never saw a body on layer 2. The reverse direction did not matter: with the Area2D's layer set to 0 and the body's mask set to 0, &lt;code&gt;body_entered&lt;/code&gt; still fired. So when a coin or trigger ignores the player, look at the trigger's Mask first.&lt;/p&gt;

&lt;p&gt;In the inspector you tick layer numbers. In &lt;code&gt;.tscn&lt;/code&gt; files and code the same values are bitmasks: layer 1 is &lt;code&gt;1&lt;/code&gt;, layer 2 is &lt;code&gt;2&lt;/code&gt;, layer 3 is &lt;code&gt;4&lt;/code&gt;, layer 4 is &lt;code&gt;8&lt;/code&gt;. A scene that says &lt;code&gt;collision_mask = 4&lt;/code&gt; scans layer 3, not layer 4. In code you can skip the arithmetic with &lt;a href="https://docs.godotengine.org/en/stable/classes/class_collisionobject2d.html#class-collisionobject2d-method-set-collision-mask-value" rel="noopener noreferrer"&gt;&lt;code&gt;set_collision_mask_value()&lt;/code&gt;&lt;/a&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight gdscript"&gt;&lt;code&gt;&lt;span class="n"&gt;extends&lt;/span&gt; &lt;span class="nc"&gt;Area2D&lt;/span&gt;

&lt;span class="n"&gt;func&lt;/span&gt; &lt;span class="nf"&gt;_ready&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;void&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="nf"&gt;set_collision_mask_value&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;true&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;body_entered&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;connect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;_on_body_entered&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;func&lt;/span&gt; &lt;span class="nf"&gt;_on_body_entered&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;body&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;Node2D&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;void&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"entered: "&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;body&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  2. Missing or disabled shape
&lt;/h3&gt;

&lt;p&gt;An Area2D with a CollisionShape2D child whose Shape is empty detected nothing in our test, and neither did one with the shape set but Disabled ticked. Select the CollisionShape2D, click the empty Shape field, pick a shape and size it over your sprite.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Monitoring is off
&lt;/h3&gt;

&lt;p&gt;With Monitoring off, our Area2D detected nothing. The &lt;a href="https://docs.godotengine.org/en/stable/classes/class_area2d.html#class-area2d-signal-body-entered" rel="noopener noreferrer"&gt;Area2D reference&lt;/a&gt; says &lt;code&gt;body_entered&lt;/code&gt; "Requires monitoring to be set to true." It defaults to on; check the inspector and any script that sets it to &lt;code&gt;false&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. The signal is not connected, or goes to the wrong node
&lt;/h3&gt;

&lt;p&gt;A &lt;code&gt;_on_body_entered&lt;/code&gt; function does nothing unless the signal is connected to it. With no connection, nothing fired in our test. Connect it in the Signals dock (the Signals tab next to the Inspector), or in code as in the snippet above.&lt;/p&gt;

&lt;p&gt;The connection also has to target the node whose script holds the method. In our example scene, a connection from the coin to the level root (which has no script) never ran &lt;code&gt;_on_body_entered&lt;/code&gt;, and Godot printed no error. If the dock shows a connection but nothing happens, check its target.&lt;/p&gt;

&lt;h3&gt;
  
  
  5. body_entered vs area_entered
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;body_entered&lt;/code&gt; fires for physics bodies (CharacterBody2D, RigidBody2D, StaticBody2D) and for tile maps whose TileSet has collision shapes. &lt;code&gt;area_entered&lt;/code&gt; fires only for other Area2Ds. In our test, listening to &lt;code&gt;area_entered&lt;/code&gt; for a CharacterBody2D never fired.&lt;/p&gt;

&lt;h3&gt;
  
  
  6. CharacterBody2D falls through the floor
&lt;/h3&gt;

&lt;p&gt;This is item 1 in the other direction: a character collides with a floor only if the floor's layer is in the character's mask. In our example project the player was on layer 2 with &lt;code&gt;collision_mask = 4&lt;/code&gt; (layer 3) and the floor was on layer 1. After 3 seconds the player was at y 4327, far below the floor at y 560. Setting the player's mask to &lt;code&gt;1&lt;/code&gt; left it resting on the floor at y 520.&lt;/p&gt;

&lt;h3&gt;
  
  
  7. TileMapLayer floor with no physics layer
&lt;/h3&gt;

&lt;p&gt;A TileMapLayer has no collision until its TileSet has a physics layer and the solid tiles have collision polygons. The steps are in our &lt;a href="https://ziva.sh/blogs/godot-tilemap#add-collision-to-a-tilemaplayer" rel="noopener noreferrer"&gt;TileMapLayer guide&lt;/a&gt;. The character's mask still has to include that physics layer's collision layer.&lt;/p&gt;

&lt;h3&gt;
  
  
  Not the cause
&lt;/h3&gt;

&lt;p&gt;Two suspects did not stop detection in our tests:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Moving the body by setting &lt;code&gt;position&lt;/code&gt;&lt;/strong&gt; instead of &lt;code&gt;move_and_slide()&lt;/code&gt;: &lt;code&gt;body_entered&lt;/code&gt; still fired. Our body moved 4 pixels per frame; we did not test large jumps that could skip over a thin area.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The body starting inside the area&lt;/strong&gt;: &lt;code&gt;body_entered&lt;/code&gt; still fired.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Tested: an AI that finds why the collision is not working
&lt;/h2&gt;

&lt;p&gt;A chat window sees only the code you paste into it, but layers, masks, shapes and signal connections live in the scene file. One Godot forum user, stuck on a jump that left their character floating, wrote that "chat gpt just scrambled my code to trash" (&lt;a href="https://forum.godotengine.org/t/character-stuck-in-air-during-jump/113942" rel="noopener noreferrer"&gt;Godot Forum&lt;/a&gt;). We wanted to see whether an agent that can read the scene and run it does better on collision bugs.&lt;/p&gt;

&lt;p&gt;Ziva.sh makes Ziva and wrote this test. We ran it on 10 November 2026 with Godot 4.7.2 on Linux, a development build of Ziva and Ziva Smart, the default model, with auto-approve on. It is one project and one run, so treat it as an example, not a benchmark.&lt;/p&gt;

&lt;p&gt;We built a small scene with four planted bugs: the player's mask missed the floor's layer, the coin's mask missed the player's layer, the coin's CollisionShape2D had no shape, and the coin's &lt;code&gt;_on_body_entered&lt;/code&gt; was never connected. &lt;strong&gt;&lt;a href="https://ziva.sh/assets/blogs/godot-collision-not-working-broken-example.zip" rel="noopener noreferrer"&gt;Download the broken project&lt;/a&gt;&lt;/strong&gt; (ZIP, 2 KB) to try it yourself. It imports and loads in Godot 4.7.2; press F5 and the player falls through the floor.&lt;/p&gt;

&lt;p&gt;The prompt, word for word:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;In res://collision_demo/level.tscn my player falls straight through the floor, and when the player touches the coin nothing happens (it should print "Coin collected" and disappear). Find out why and fix it. Run the scene to check it works.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;What Ziva did:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Read the scene tree, &lt;code&gt;level.tscn&lt;/code&gt;, and both scripts.&lt;/li&gt;
&lt;li&gt;Called &lt;code&gt;validate_physics_setup&lt;/code&gt; on the Player and the Floor. It returned one issue: &lt;code&gt;"collision_mask does not overlap with any platform collision_layer"&lt;/code&gt; on &lt;code&gt;/root/Player&lt;/code&gt;, and the suggestion &lt;code&gt;"Update collision_mask on /root/Player to include bits from platform layers"&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Listed all four bugs. The tool had flagged only the first; Ziva found the coin's mask, the missing shape and the missing connection in the scene file it had read.&lt;/li&gt;
&lt;li&gt;Fixed them by editing &lt;code&gt;level.tscn&lt;/code&gt;: player mask &lt;code&gt;4&lt;/code&gt; to &lt;code&gt;1&lt;/code&gt;, coin mask &lt;code&gt;1&lt;/code&gt; to &lt;code&gt;2&lt;/code&gt;, a 24 x 24 RectangleShape2D for the coin, and a &lt;code&gt;body_entered&lt;/code&gt; connection.&lt;/li&gt;
&lt;li&gt;Caught its own mistake: it first connected the signal to the level root, then noticed that &lt;code&gt;_on_body_entered&lt;/code&gt; lives in the coin's script and changed the target to the Coin node before running anything.&lt;/li&gt;
&lt;li&gt;Ran &lt;code&gt;validate_physics_setup&lt;/code&gt; again (no issues), then ran the scene. Godot printed &lt;code&gt;Coin collected&lt;/code&gt;, and Ziva's screenshot showed the player on the floor with the coin gone.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F8d0u4qotnsqwnqc0weli.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F8d0u4qotnsqwnqc0weli.webp" alt="Ziva's run_scene screenshot after the fix: the Godot icon player resting on the green floor, with no coin left in the scene" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It took 1 minute 34 seconds, 16 tool calls and $0.0175 of Ziva usage on Ziva Smart, the default model. Our own check, a separate script run on the fixed project, agreed: the player rested on the floor at y 520, &lt;code&gt;Coin collected&lt;/code&gt; was printed and the coin was removed.&lt;/p&gt;

&lt;h3&gt;
  
  
  What validate_physics_setup checks, and what it does not
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;validate_physics_setup&lt;/code&gt; takes a scene, the character nodes and the platform nodes. For each character it checks that the collision mask is not 0, that the mask overlaps at least one platform's collision layer, and that it has a CollisionShape2D child with a shape. For TileMapLayer platforms it checks that a TileSet is assigned and has a physics layer. It returns a list of issues and suggestions.&lt;/p&gt;

&lt;p&gt;It does not look at Area2Ds, monitoring or signal connections. In this run it caught the floor bug only. The three coin bugs were found by the model reading the scene, so on a bigger scene that part depends on Ziva reading the right files.&lt;/p&gt;

&lt;h3&gt;
  
  
  Where Ziva slipped
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;A wrong signal target, caught in time.&lt;/strong&gt; Its first connection pointed at the level root, which would have failed without an error, as item 4 above shows. Ziva fixed it before running the scene.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;One small scene.&lt;/strong&gt; The scene had three nodes that mattered and the bugs were all visible in one file. We have not tested Ziva on a collision bug spread across many scenes or caused by code that changes layers at runtime.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To try it on your own project, &lt;a href="https://ziva.sh/docs/installation" rel="noopener noreferrer"&gt;install Ziva&lt;/a&gt; and describe the symptom the way you would to a person, for example "my player falls through the floor, find out why and fix it, then run the scene."&lt;/p&gt;

&lt;h2&gt;
  
  
  FAQ
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Why is my Godot Area2D body_entered signal not firing?
&lt;/h3&gt;

&lt;p&gt;In our Godot 4.7.2 tests, body_entered stayed silent when the Area2D's collision mask did not include the body's collision layer, when its CollisionShape2D had no shape or was disabled, when Monitoring was off, when the signal was not connected, and when the code listened to area_entered instead of body_entered for a CharacterBody2D. Check those in that order. The Area2D's own layer and the body's mask did not matter.&lt;/p&gt;

&lt;h3&gt;
  
  
  What is the difference between collision layers and masks in Godot?
&lt;/h3&gt;

&lt;p&gt;The collision layer is the set of layers an object is on. The collision mask is the set of layers it scans for collisions. An Area2D detects a body only if the body's layer is in the Area2D's mask, and a CharacterBody2D stops on a floor only if the floor's layer is in the character's mask. In .tscn files and code the values are bitmasks: layer 1 is 1, layer 2 is 2, layer 3 is 4, layer 4 is 8.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why does my CharacterBody2D fall through the floor in Godot?
&lt;/h3&gt;

&lt;p&gt;Check the character's collision mask first: it must include the floor's collision layer. In our example the player had mask 4 (layer 3) and the floor was on layer 1, and the player fell to y 4327 in 3 seconds. Ticking layer 1 in the player's Mask fixed it. A missing CollisionShape2D shape or a TileMapLayer whose TileSet has no physics layer gives the same symptom.&lt;/p&gt;

&lt;h3&gt;
  
  
  Is there an AI tool that finds why Godot collision isn't working?
&lt;/h3&gt;

&lt;p&gt;Ziva, an AI agent that runs inside the Godot editor, found and fixed all four planted bugs in our broken test scene in 1 minute 34 seconds: the player's mask, the coin's mask, a missing collision shape and an unconnected signal. Its validate_physics_setup tool flagged only the player and floor mask mismatch; Ziva found the other three by reading the scene file. It then ran the scene and saw Coin collected printed. This was one project and one run.&lt;/p&gt;

&lt;h3&gt;
  
  
  Does the body's collision mask need to include the Area2D's layer?
&lt;/h3&gt;

&lt;p&gt;No, not for the Area2D to detect the body. In our Godot 4.7.2 test we set the Area2D's layer to 0 and the body's mask to 0, and body_entered still fired, because the Area2D's mask included the body's layer. Only the detecting object's mask has to match the other object's layer.&lt;/p&gt;

</description>
      <category>godot</category>
      <category>gamedev</category>
      <category>ai</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Godot UI with AI: a main menu and settings screen that don't clip (tested)</title>
      <dc:creator>Ziva</dc:creator>
      <pubDate>Tue, 10 Nov 2026 03:04:24 +0000</pubDate>
      <link>https://dev.to/ziva/godot-ui-with-ai-a-main-menu-and-settings-screen-that-dont-clip-tested-1nk4</link>
      <guid>https://dev.to/ziva/godot-ui-with-ai-a-main-menu-and-settings-screen-that-dont-clip-tested-1nk4</guid>
      <description>&lt;p&gt;Can an AI build Godot UI that holds together when the window changes size? We asked &lt;a href="https://ziva.sh" rel="noopener noreferrer"&gt;Ziva&lt;/a&gt;, an AI agent that runs inside the Godot editor, for a main menu and a settings screen made of Control nodes. In 3 minutes 58 seconds it built both scenes, ran the game, clicked Settings and Back, and checked the layout at five window sizes. Nothing was clipped. It also missed something: the Fullscreen checkbox was nearly invisible when unchecked, and Ziva reported "all controls showing". A second prompt asking it to look closely caught and fixed it.&lt;/p&gt;

&lt;p&gt;Layout is where people say AI help breaks down. On r/ClaudeAI one developer wrote that "Claude does not do a very good job in creating and modifying scenes for Godot … Elements are often partially clipped" (&lt;a href="https://www.reddit.com/r/ClaudeAI/comments/1ryyfqw/" rel="noopener noreferrer"&gt;thread&lt;/a&gt;). On r/aigamedev another wrote, "I can burn through Claude's usage limit in a single session just trying to fix layouts and styling" (&lt;a href="https://www.reddit.com/r/aigamedev/comments/1uc0o26/" rel="noopener noreferrer"&gt;thread&lt;/a&gt;). And without any AI involved, a Godot forum post says "Making UIs almost takes up 80% of my time" (&lt;a href="https://forum.godotengine.org/t/the-ui-system-of-godot-is-too-difficult-to-use/107080" rel="noopener noreferrer"&gt;thread&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;Ziva.sh makes Ziva and wrote this test. We ran it on 10 November 2026 with Godot 4.7.2 on Linux, using a development build of Ziva on Ziva Smart, the default model, with auto-approve on. It is one project and one run, so treat it as an example, not a benchmark. Below are the layout Ziva built (you can copy it by hand), how it checked the result, the miss, and a checklist.&lt;/p&gt;

&lt;h2&gt;
  
  
  The prompt
&lt;/h2&gt;

&lt;p&gt;A fresh project with no UI in it. The prompt, word for word:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Make a main menu for my game in res://ui_demo/: the game title and Play, Settings and Quit buttons, centered. Settings should open a settings screen with a Master volume slider, a Fullscreen checkbox, a Resolution dropdown (1280x720 and 1920x1080) and a Back button that returns to the menu. Nothing should be clipped or overlapping, and it should still look right if the window is resized. Check it with screenshots and click through Settings and Back to make sure they work.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  The layout Ziva built
&lt;/h2&gt;

&lt;p&gt;Ziva wrote two scripts and two scenes in &lt;code&gt;res://ui_demo/&lt;/code&gt;. The main menu:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;MainMenu (Control, Full Rect anchors, main_menu.gd)
├── Background (ColorRect, Full Rect)
├── MenuPanel (CenterContainer, Full Rect)
│   └── MenuBox (VBoxContainer, separation 20)
│       ├── Title (Label "My Game", font size 56)
│       ├── PlayButton (Button, custom_minimum_size 260 x 52)
│       ├── SettingsButton (Button, custom_minimum_size 260 x 52)
│       └── QuitButton (Button, custom_minimum_size 260 x 52)
└── SettingsScreen (instance of settings_screen.tscn, hidden)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The settings screen is its own scene with its own opaque background, instanced into the menu and hidden until needed:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SettingsScreen (Control, Full Rect anchors, settings_screen.gd)
├── Background (ColorRect, Full Rect)
└── Center (CenterContainer, Full Rect)
    └── Margin (MarginContainer, 24 px margins)
        └── VBox (VBoxContainer, separation 16)
            ├── Title (Label "Settings")
            ├── VolumeRow (HBoxContainer)
            │   ├── Label "Master Volume" (Expand)
            │   └── VolumeSlider (HSlider 0 to 1, min width 220)
            ├── FullscreenCheck (CheckBox)
            ├── ResolutionRow (HBoxContainer)
            │   ├── Label "Resolution" (Expand)
            │   └── ResolutionOption (OptionButton, min width 220)
            └── BackButton (Button, 240 x 48, Shrink Center)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Settings hides &lt;code&gt;MenuPanel&lt;/code&gt; and shows the settings screen; the settings screen emits a &lt;code&gt;back_requested&lt;/code&gt; signal, and the menu shows itself again and gives Play keyboard focus. Quit calls &lt;code&gt;get_tree().quit()&lt;/code&gt;. Play only prints a placeholder message, because the project had no game scene to load, and Ziva said so. The settings handlers, as Ziva wrote them:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight gdscript"&gt;&lt;code&gt;&lt;span class="n"&gt;func&lt;/span&gt; &lt;span class="nf"&gt;_on_volume_changed&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;float&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;void&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;db&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;float&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;linear_to_db&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;value&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mf"&gt;0.0&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mf"&gt;80.0&lt;/span&gt;
    &lt;span class="nc"&gt;AudioServer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;set_bus_volume_db&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;AudioServer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get_bus_index&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Master"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;db&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;func&lt;/span&gt; &lt;span class="nf"&gt;_on_fullscreen_toggled&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;toggled_on&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;bool&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;void&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;mode&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;DisplayServer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;WindowMode&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;DisplayServer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;WINDOW_MODE_FULLSCREEN&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;toggled_on&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="nc"&gt;DisplayServer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;WINDOW_MODE_WINDOWED&lt;/span&gt;
    &lt;span class="nc"&gt;DisplayServer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;window_set_mode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;mode&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;func&lt;/span&gt; &lt;span class="nf"&gt;_on_resolution_selected&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;index&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;void&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;index&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="ow"&gt;or&lt;/span&gt; &lt;span class="n"&gt;index&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="no"&gt;RESOLUTIONS&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;size&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt;
    &lt;span class="nc"&gt;DisplayServer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;window_set_size&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="no"&gt;RESOLUTIONS&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;index&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="nf"&gt;_center_window&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The settings are not saved between launches. The prompt did not ask for that and Ziva did not add it. If you need it, write the values to a &lt;a href="https://docs.godotengine.org/en/stable/classes/class_configfile.html" rel="noopener noreferrer"&gt;ConfigFile&lt;/a&gt; in &lt;code&gt;user://&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why this layout doesn't clip
&lt;/h2&gt;

&lt;p&gt;Most clipped Godot UI comes from controls placed by hand. A control's offsets are pixel distances from an anchor point, by default the parent's top-left corner (&lt;a href="https://docs.godotengine.org/en/stable/tutorials/ui/size_and_anchors.html" rel="noopener noreferrer"&gt;Size and anchors&lt;/a&gt;). A button placed at x = 900 in a 1152-pixel window sits outside a 640-pixel one.&lt;/p&gt;

&lt;p&gt;The layout above has no hand-placed child positions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The root fills the window.&lt;/strong&gt; &lt;code&gt;MainMenu&lt;/code&gt;, &lt;code&gt;Background&lt;/code&gt; and &lt;code&gt;MenuPanel&lt;/code&gt; use the Full Rect anchor preset (anchors 0 to 1 on both axes), so they always match the window.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A CenterContainer does the centering.&lt;/strong&gt; It "automatically keeps all of its child controls centered within it at their minimum size" (&lt;a href="https://docs.godotengine.org/en/stable/tutorials/ui/gui_containers.html" rel="noopener noreferrer"&gt;Using Containers&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Box containers stack the rows.&lt;/strong&gt; Inside a container, "all children Control nodes give up their own positioning ability" (same page), so a resize re-lays out everything.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Minimum sizes set the size.&lt;/strong&gt; The buttons get their size from &lt;code&gt;custom_minimum_size&lt;/code&gt;, and the labels in each settings row have Expand set so the label and the 220-pixel slider or dropdown share the row without overlapping.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;One limit: a container never shrinks its children below their minimum size. Ziva's menu box is 260 x 293 pixels, so in a window shorter than 293 pixels it no longer fits. If your game must work in very small windows, or should scale the UI up on big screens, set Project Settings &amp;gt; Display &amp;gt; Window &amp;gt; Stretch &amp;gt; Mode to &lt;code&gt;canvas_items&lt;/code&gt; (&lt;a href="https://docs.godotengine.org/en/stable/tutorials/rendering/multiple_resolutions.html" rel="noopener noreferrer"&gt;Multiple resolutions&lt;/a&gt;). Ziva's project kept the default, Disabled, so on a 1920 x 1080 window the menu stays the same pixel size in the middle of a larger screen.&lt;/p&gt;

&lt;h2&gt;
  
  
  How Ziva checked it
&lt;/h2&gt;

&lt;p&gt;Ziva's &lt;code&gt;run_scene&lt;/code&gt; tool runs a scene from the editor, sends input and returns a screenshot. Ziva used it three times:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Run the menu and look at the screenshot. It also fixed an integer-division warning from the run's output.&lt;/li&gt;
&lt;li&gt;Run again and click the button labelled Settings. The screenshot showed the settings screen, and Ziva wrote: "Settings screen opens with all controls showing, nothing clipped."&lt;/li&gt;
&lt;li&gt;Run again, clicking Settings and then Back. The screenshot showed the menu with Play focused.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;code&gt;run_scene&lt;/code&gt; runs the game at the project's window size (here Godot's default, 1152 x 648) and can't resize it, so screenshots alone could not show a resize. Ziva noted that and wrote a GDScript test that loaded the menu at several window sizes and checked that the menu box and the settings box stayed inside the window. Its first measurement said neither fit at 1152 x 648. Ziva decided the layout had not been applied on the first frame and reran 1152 x 648 with a warm-up, plus 800 x 450 and 3840 x 2160. Across both runs it passed at 640 x 360, 800 x 450, 1152 x 648, 1920 x 1080 and 3840 x 2160.&lt;/p&gt;

&lt;p&gt;We then ran our own check on a copy of the project: at 1152 x 648, 640 x 360, 1920 x 1080 and 800 x 600, no visible Control was outside the window or smaller than its content, Settings opened, and Back returned to the menu.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F5yc57yemd3w03jqmx0oz.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F5yc57yemd3w03jqmx0oz.webp" alt="Ziva's first-pass settings screen rendered by our check at four window sizes: 640 x 360, 1152 x 648, 1920 x 1080 and 800 x 600. The content stays centered and inside the window at every size." width="800" height="587"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The miss: an invisible checkbox
&lt;/h2&gt;

&lt;p&gt;Both checks passed a settings screen with a problem. With Godot's default theme the unchecked CheckBox box is dark, and on Ziva's dark background it almost disappeared, so "Fullscreen" looked like a plain label. Ziva's own screenshot showed it, and Ziva still reported all controls showing. Our geometry check could not see it either: the checkbox was the right size and inside the window.&lt;/p&gt;

&lt;p&gt;We sent a second prompt in the same chat:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Look closely at the settings screen in a screenshot. Is every control easy to see and use? Fix anything that isn't, then show me the settings screen again.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This time Ziva opened its earlier screenshot and said the Fullscreen checkbox "looks like plain centered text with no visible indicator". It built a throwaway scene with a checked and an unchecked CheckBox on the same background, ran it, and confirmed that only the checked one showed a box. Then it added code to &lt;code&gt;settings_screen.gd&lt;/code&gt; that draws its own checked and unchecked icons into a Theme on the checkbox, and ran the menu twice more, clicking Settings and then Fullscreen to see both states. Our check afterwards passed at the same four sizes, with the checkbox outline visible.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F33det165emu2e670ufpx.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F33det165emu2e670ufpx.webp" alt="Ziva's settings screen before and after the second prompt. Left: the unchecked Fullscreen checkbox shows almost no box. Right: a light outlined box next to Fullscreen." width="799" height="295"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Two things to know about that fix. Drawing icons pixel by pixel in a script works, but about 60 lines of code for one checkbox is a lot; in your own project a Theme resource with checkbox icons, set on the root Control, does the same for every CheckBox below it, because themes apply to a control and its children (&lt;a href="https://docs.godotengine.org/en/stable/tutorials/ui/gui_skinning.html" rel="noopener noreferrer"&gt;GUI skinning&lt;/a&gt;). And Ziva left the throwaway scene, &lt;code&gt;ui_demo/_tmp_check.tscn&lt;/code&gt;, in the project. It said so in its reply: it "didn't delete it since removal wasn't requested" and offered to remove it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Time and cost
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;First prompt:&lt;/strong&gt; 3 min 58 s, $0.033 of Ziva usage on Ziva Smart, the default model.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Follow-up prompt:&lt;/strong&gt; 4 min 6 s, $0.036.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What this test does not show
&lt;/h2&gt;

&lt;p&gt;One simple UI, the default theme, one run. We did not check that Fullscreen and Resolution change a real desktop window, or keyboard and gamepad navigation between the controls. Ziva's run window is embedded in the editor and only supports windowed mode, as Ziva pointed out. A larger UI, a custom theme or a different model may give different results.&lt;/p&gt;

&lt;h2&gt;
  
  
  Checklist: a Godot menu and settings screen that don't clip
&lt;/h2&gt;

&lt;p&gt;Whether you build it yourself or ask an AI, these steps follow the layout above:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Add a root &lt;code&gt;Control&lt;/code&gt; and choose Full Rect from the anchor preset menu in the toolbar above the viewport.&lt;/li&gt;
&lt;li&gt;Add a &lt;code&gt;ColorRect&lt;/code&gt; background, also Full Rect.&lt;/li&gt;
&lt;li&gt;Add a &lt;code&gt;CenterContainer&lt;/code&gt; (Full Rect) and a &lt;code&gt;VBoxContainer&lt;/code&gt; inside it. Put the title and buttons in the VBoxContainer.&lt;/li&gt;
&lt;li&gt;Size buttons with Custom Minimum Size instead of dragging their handles.&lt;/li&gt;
&lt;li&gt;Make the settings screen its own scene with its own background. Instance it in the menu, hide it, and show or hide it from the menu script. Use HBoxContainers for label and control rows, with Expand on the labels.&lt;/li&gt;
&lt;li&gt;Check several window sizes. Run the scene and resize the window, or run a script like the one below.&lt;/li&gt;
&lt;li&gt;Look at a screenshot of every screen on its real background, in every state (checked and unchecked, focused and not). A layout check can't tell you a control is hard to see.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Here is a short size check, based on what Ziva did. Save it in the project folder and run &lt;code&gt;godot --headless --path . --script check_layout.gd&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight gdscript"&gt;&lt;code&gt;&lt;span class="n"&gt;extends&lt;/span&gt; &lt;span class="nc"&gt;SceneTree&lt;/span&gt;

&lt;span class="n"&gt;func&lt;/span&gt; &lt;span class="nf"&gt;_initialize&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;void&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;menu&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;Control&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;load&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"res://ui_demo/main_menu.tscn"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;instantiate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;root&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;add_child&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;menu&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="c1"&gt;# The window applies its own size on the first frame, so measuring before this reads a stale layout.&lt;/span&gt;
    &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;process_frame&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;size&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;Vector2i&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nc"&gt;Vector2i&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;640&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;360&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;Vector2i&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1152&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;648&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;Vector2i&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1920&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1080&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;Vector2i&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;400&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;240&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;root&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;size&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;size&lt;/span&gt;
        &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;process_frame&lt;/span&gt;
        &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;box&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;Rect2&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;menu&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get_node&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"MenuPanel/MenuBox"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get_global_rect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;size&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;" menu fits: "&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;Rect2&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;Vector2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;ZERO&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;Vector2&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;size&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;encloses&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;box&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="nf"&gt;quit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;On Ziva's menu it prints &lt;code&gt;true&lt;/code&gt; for the first three sizes and &lt;code&gt;false&lt;/code&gt; for 400 x 240, the minimum-size limit described above.&lt;/p&gt;

&lt;p&gt;To try Ziva on your own UI, see &lt;a href="https://ziva.sh/docs/installation" rel="noopener noreferrer"&gt;installation&lt;/a&gt;. We ran the same kind of test on &lt;a href="https://ziva.sh/blogs/godot-shaders" rel="noopener noreferrer"&gt;a broken shader&lt;/a&gt; and on &lt;a href="https://ziva.sh/blogs/godot-collision-not-working" rel="noopener noreferrer"&gt;collision bugs&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  FAQ
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Can AI build UI in Godot?
&lt;/h3&gt;

&lt;p&gt;In our test, mostly yes. We asked Ziva, an AI agent that runs inside the Godot editor, for a main menu and a settings screen made of Control nodes. In about 4 minutes it built both scenes, clicked through Settings and Back in the running game, and checked the layout at five window sizes. It missed one problem: the unchecked Fullscreen checkbox was nearly invisible on the dark background. A second prompt asking it to look closely caught and fixed that. This was one project and one run on 10 November 2026, so treat it as an example, not a benchmark.&lt;/p&gt;

&lt;h3&gt;
  
  
  How do I make a Godot main menu that doesn't clip when the window is resized?
&lt;/h3&gt;

&lt;p&gt;Build it from containers instead of hand-placed positions. Give the root Control the Full Rect anchor preset so it always matches the window, add a CenterContainer with Full Rect anchors, put a VBoxContainer inside it, and size the buttons with Custom Minimum Size. Children of a container give up their own positioning, so the container re-centers them whenever the window changes size. A container never shrinks its children below their minimum size, so very small windows still need a stretch mode such as canvas_items.&lt;/p&gt;

&lt;h3&gt;
  
  
  How do I make a settings menu in Godot with volume, fullscreen and resolution?
&lt;/h3&gt;

&lt;p&gt;Make the settings screen its own scene, instance it in the menu scene, and show or hide it from the menu script. For the controls: an HSlider from 0 to 1 sets the Master bus volume with AudioServer.set_bus_volume_db and linear_to_db, a CheckBox switches DisplayServer.window_set_mode between fullscreen and windowed, and an OptionButton calls DisplayServer.window_set_size with the chosen resolution. Save the values with ConfigFile if they should survive a restart.&lt;/p&gt;

&lt;h3&gt;
  
  
  How do I test a Godot UI at different window sizes?
&lt;/h3&gt;

&lt;p&gt;Run the scene and resize the game window, or run a short script that sets the root window size to several values, waits a few frames for the containers to lay out, and checks that each container's rectangle is inside the window. Wait one frame before the first measurement: in our test, Ziva's first measurement read a stale layout. A layout check cannot tell you whether a control is easy to see, so also look at a screenshot.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why is my Godot CheckBox invisible on a dark background?
&lt;/h3&gt;

&lt;p&gt;With Godot 4.7.2's default theme, the unchecked CheckBox box is drawn dark. On the dark background Ziva chose (Color(0.09, 0.1, 0.14)), the unchecked box almost disappeared, while the checked box was clearly visible. Fix it with your own checked and unchecked icons in a Theme resource, or use a lighter background behind the checkbox.&lt;/p&gt;

</description>
      <category>godot</category>
      <category>ai</category>
      <category>gamedev</category>
      <category>ui</category>
    </item>
    <item>
      <title>AI assistant for a large Godot project: Ziva and Claude Code tested on Pixelorama</title>
      <dc:creator>Ziva</dc:creator>
      <pubDate>Sat, 07 Nov 2026 15:23:20 +0000</pubDate>
      <link>https://dev.to/ziva/ai-assistant-for-a-large-godot-project-ziva-and-claude-code-tested-on-pixelorama-1pi5</link>
      <guid>https://dev.to/ziva/ai-assistant-for-a-large-godot-project-ziva-and-claude-code-tested-on-pixelorama-1pi5</guid>
      <description>&lt;p&gt;Can an AI assistant work in a large Godot project without losing track? We gave &lt;a href="https://ziva.sh" rel="noopener noreferrer"&gt;Ziva&lt;/a&gt; and &lt;a href="https://claude.ai/code" rel="noopener noreferrer"&gt;Claude Code&lt;/a&gt; the same feature to build in &lt;a href="https://github.com/Orama-Interactive/Pixelorama" rel="noopener noreferrer"&gt;Pixelorama&lt;/a&gt;, an open-source pixel art editor written in Godot 4 with 249 GDScript files (about 60,000 lines) and 120 scenes. Both used Claude Opus 5.5. The feature touched 8 files: a shader, a new dialog scene and script, the menu code, the shortcut list, the layer effects list, project settings and the translation template.&lt;/p&gt;

&lt;p&gt;All four runs, two per tool, passed the same independent check in the running app. Ziva finished in 6 and 13 minutes; Claude Code took about 16 minutes both times. Claude Code tested its own work more thoroughly. Ziva's game runner could not screenshot Pixelorama while it sat idle, and Ziva left stray files in the project root. Details below.&lt;/p&gt;

&lt;p&gt;Ziva.sh makes Ziva and wrote this test. We ran it on 7 November 2026 with Godot 4.7.2 on Linux, on Pixelorama commit &lt;code&gt;5b2ebf5&lt;/code&gt; (MIT license), using a development build of Ziva from that day and Claude Code 2.1.318. Each tool used its default reasoning setting. The first runs of the two tools overlapped in time and the second runs started together on the same machine, so they shared its CPU. Claude Opus 5.5 in Ziva needs the Pro plan ($50/month).&lt;/p&gt;

&lt;h2&gt;
  
  
  The task
&lt;/h2&gt;

&lt;p&gt;Both tools got this prompt, word for word, in a fresh copy of the project:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Add a Sepia color effect to this project (Pixelorama). It should work like the existing color effects:

1. Effects &amp;gt; Color &amp;gt; Sepia opens a dialog with an Intensity slider (0 to 100%, default 100%) and a live preview. Applying it works on the same targets as Desaturation (selected cels, current frame, all frames, all projects, and only the selection when that option is checked), with undo.
2. Sepia gets its own shortcut entry in Preferences &amp;gt; Shortcuts like the other effects (no default key).
3. Sepia is also available as a non-destructive layer effect in the Layer Effects dialog, with the same Intensity parameter.

Follow the project's existing patterns for effects. When you are done, make sure the project still opens and runs without new errors.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is the kind of change where an assistant "loses track" in a big project. Nothing in the prompt says where effects are registered. Pixelorama wires each effect in five places, and missing one gives a menu item that does nothing, a shortcut that never appears, or no layer effect at all.&lt;/p&gt;

&lt;p&gt;Ziva ran in the Godot editor with auto-approve on. Claude Code ran in a terminal with no plugins, MCP servers or project instructions, permissions auto-approved, and Godot and a virtual display available on the command line.&lt;/p&gt;

&lt;h2&gt;
  
  
  Results
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;Ziva run 1&lt;/th&gt;
&lt;th&gt;Ziva run 2&lt;/th&gt;
&lt;th&gt;Claude Code run 1&lt;/th&gt;
&lt;th&gt;Claude Code run 2&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Our check in the running app&lt;/td&gt;
&lt;td&gt;Pass&lt;/td&gt;
&lt;td&gt;Pass&lt;/td&gt;
&lt;td&gt;Pass&lt;/td&gt;
&lt;td&gt;Pass&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Time&lt;/td&gt;
&lt;td&gt;6 min 15 s&lt;/td&gt;
&lt;td&gt;12 min 50 s&lt;/td&gt;
&lt;td&gt;16 min 0 s&lt;/td&gt;
&lt;td&gt;15 min 50 s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Cost&lt;/td&gt;
&lt;td&gt;$1.94 of Ziva plan usage&lt;/td&gt;
&lt;td&gt;$2.93&lt;/td&gt;
&lt;td&gt;$2.70 (Claude Code's API-price estimate)&lt;/td&gt;
&lt;td&gt;$3.58&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Peak context&lt;/td&gt;
&lt;td&gt;137,000 tokens&lt;/td&gt;
&lt;td&gt;157,000 tokens&lt;/td&gt;
&lt;td&gt;135,000 tokens&lt;/td&gt;
&lt;td&gt;164,000 tokens&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Files left in the project root&lt;/td&gt;
&lt;td&gt;its test scene and script (Ziva said so)&lt;/td&gt;
&lt;td&gt;an untitled.png it could not explain (Ziva said so)&lt;/td&gt;
&lt;td&gt;none&lt;/td&gt;
&lt;td&gt;none&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Its own testing&lt;/td&gt;
&lt;td&gt;Selected cels target only&lt;/td&gt;
&lt;td&gt;Selected cels and selection-only&lt;/td&gt;
&lt;td&gt;All four targets, save and load, 82 checks&lt;/td&gt;
&lt;td&gt;85 checks&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Our check was the same script for every run. It opened Effects &amp;gt; Color &amp;gt; Sepia in the running app, applied it to a blue canvas, undid it, applied 50% to a selection only, confirmed the shortcut entry, and added Sepia as a layer effect. All four produced identical pixel values, and none added new errors to the startup log.&lt;/p&gt;

&lt;p&gt;On a Claude subscription you pay a flat fee rather than Claude Code's estimate, and Ziva's cost depends on your plan's included usage. Neither run came close to the model's context limit, so this test does not show how either tool handles a chat long enough to need summarizing.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ft97qc4x9haxyodyixku7.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ft97qc4x9haxyodyixku7.webp" alt="Pixelorama with the Sepia dialog Ziva built: an Intensity slider at 100 %, a sepia-toned preview, the Only affect selection checkbox and the Selected cels target" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  How Ziva found its way around 1,383 files
&lt;/h2&gt;

&lt;p&gt;Ziva does not index or embed your code, and it does not load the project into the model. In both runs its first step was one search for "desaturat" across scripts, scenes, shaders, project settings and translation files. That found every place the existing Desaturation effect is wired. It then read 17 files in run 1 and 22 in run 2 and copied the pattern.&lt;/p&gt;

&lt;p&gt;A few things helped on the way, and they come from Ziva running inside the Godot editor:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;GDScript checked after every script edit.&lt;/strong&gt; Each time Ziva created or edited a &lt;code&gt;.gd&lt;/code&gt; file, Godot's language server checked it and the files that depend on it. Every one came back with "No problems in this file or its callers."&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Project settings through Godot.&lt;/strong&gt; Ziva added the shortcut's input action with Godot's project settings API instead of editing &lt;code&gt;project.godot&lt;/code&gt; by hand, and in run 1 it read the live input map first.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The real app, not a stub.&lt;/strong&gt; Ziva ran Pixelorama's main scene from the editor and read its output and errors.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A memory for next time.&lt;/strong&gt; In run 2 Ziva saved a project memory describing how to test Pixelorama code, so the next chat starts with a pointer to it. See &lt;a href="https://ziva.sh/docs/agents-md#memories" rel="noopener noreferrer"&gt;memories&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Claude Code got there with shell tools instead: &lt;code&gt;grep&lt;/code&gt;, &lt;code&gt;sed&lt;/code&gt;, and Godot from the command line on a virtual display. Its output landed in the same files.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where Ziva struggled
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Ziva's game runner timed out on an idle Pixelorama.&lt;/strong&gt; Pixelorama turns on Godot's low-processor mode, so it only redraws when something changes. Ziva's &lt;code&gt;run_scene&lt;/code&gt; waits for a drawn frame to screenshot, and running the main scene timed out after about 35 seconds, twice in each run. We confirmed the cause: with low-processor mode off, the same call returned a screenshot. Ziva worked around it with a temporary test scene that drove the app and printed its results. In run 2 that scene kept the app drawing, so &lt;code&gt;run_scene&lt;/code&gt; returned screenshots too.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Ziva's script runner could not load Pixelorama's autoloads.&lt;/strong&gt; Its one-off GDScript runner reported "Identifier not found: Global", so Ziva switched to the test scene above.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Stray files.&lt;/strong&gt; Run 1 left its test scene and script in the project root and asked whether to delete them. Run 2 deleted its test files, but an &lt;code&gt;untitled.png&lt;/code&gt; appeared in the root during testing, and Ziva flagged it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Less testing than Claude Code.&lt;/strong&gt; Ziva tested only the Selected cels target and said so. Claude Code tested all four targets plus saving and loading. In run 1 it also reported a likely bug in Pixelorama's shared effect code, where applying an effect to all projects crops other projects with the current project's size. We read the line and it matches the report, but we did not reproduce it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The Full Game Playtest Agent did not run.&lt;/strong&gt; Ziva tried it in both runs, but a credential problem in our local test setup stopped it before it started. This test says nothing about it either way.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What this test does not show
&lt;/h2&gt;

&lt;p&gt;It is one project, one feature, two runs per tool, and one model. The task added a feature across many files. It was not a rename or a move of files across many scenes, which we have not tested yet. Neither tool needed to summarize its chat. Results with other models, a bigger project or a vaguer prompt may differ.&lt;/p&gt;

&lt;h2&gt;
  
  
  If your AI loses track as your project grows
&lt;/h2&gt;

&lt;p&gt;These habits helped in this test and work with any assistant:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Point it at an existing example.&lt;/strong&gt; "Make it work like Desaturation" told both tools where to look. Name a similar scene, script or system in your project.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Write your project's rules down.&lt;/strong&gt; Ziva reads an &lt;code&gt;AGENTS.md&lt;/code&gt; file in your project, and Claude Code reads &lt;code&gt;CLAUDE.md&lt;/code&gt;. Put your folder layout, autoloads and conventions there so the assistant does not rediscover them every chat.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Ask it to run the project.&lt;/strong&gt; Both tools ran Pixelorama and read its errors before reporting back. An assistant that only edits text cannot see a scene that fails to load.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Start a new chat for a new task.&lt;/strong&gt; A long chat full of old file contents leaves less room for the current change.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For a broader comparison of the two tools, see &lt;a href="https://ziva.sh/blogs/ziva-vs-claude-code-for-godot" rel="noopener noreferrer"&gt;Ziva vs Claude Code for Godot&lt;/a&gt;. If you use Claude Code and want Ziva's Godot tools inside it, Ziva can run as a &lt;a href="https://ziva.sh/docs/ziva-mcp-server" rel="noopener noreferrer"&gt;local MCP server&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  FAQ
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Can an AI assistant handle a large Godot project?
&lt;/h3&gt;

&lt;p&gt;In our test, yes. We asked Ziva and Claude Code, both running Claude Opus 5.5, to add a Sepia effect to Pixelorama (249 GDScript files, about 60,000 lines, 120 scenes). The change touched 8 files across a shader, a dialog scene and script, the menu code, the shortcut list, the layer effects list, project settings and the translation template. All four runs (two per tool) passed the same independent check in the running app. This is one project and one task, so treat it as an example, not a benchmark.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why does the AI lose track as my Godot project grows?
&lt;/h3&gt;

&lt;p&gt;A model can only see what is in its context window, and a large project does not fit. The agent has to search for the right files, read only those, and keep its notes as the chat grows. In our Pixelorama test Ziva read 17 and 22 of the project's 1,383 files, and its context peaked at 137,000 and 157,000 tokens, far below Claude Opus 5.5's limit. Ziva also checks every GDScript edit with Godot's language server, can save project memories that carry over to new chats, reads an AGENTS.md file with your project's rules, and summarizes long chats automatically when they near the model's limit.&lt;/p&gt;

&lt;h3&gt;
  
  
  Can Ziva refactor across many Godot files?
&lt;/h3&gt;

&lt;p&gt;We tested a multi-file feature, not a rename: Ziva created a shader, a dialog scene and its script, and edited five existing files, including project.godot through Godot's own project settings API. Both Ziva runs passed our check. We have not yet tested a large rename or move across many scenes.&lt;/p&gt;

&lt;h3&gt;
  
  
  Is Claude Code or Ziva better for a large Godot project?
&lt;/h3&gt;

&lt;p&gt;On this task both produced working code. Ziva finished in 6 and 13 minutes and charged $1.94 and $2.93 of plan usage. Claude Code took about 16 minutes each time and estimated $2.70 and $3.58 at API prices. Claude Code tested more thoroughly: it checked all four apply targets and save and load, and in one run reported a likely bug in Pixelorama's shared effect code. Ziva tested only the default target, and each run left files in the project root that Ziva pointed out.&lt;/p&gt;

&lt;h3&gt;
  
  
  Does Ziva index my whole project?
&lt;/h3&gt;

&lt;p&gt;No. Ziva has no embedding or semantic index of your code. It searches the project when it needs something, with ripgrep-based file and text search, and reads files in windows. The Indexing project message you may see on a big project's first chat builds the history Ziva uses for Undo, not a code index.&lt;/p&gt;

&lt;h3&gt;
  
  
  Can I use my own Claude or ChatGPT subscription in Godot?
&lt;/h3&gt;

&lt;p&gt;Yes. Sign in with your Claude Pro or Max, or ChatGPT Plus or Pro, account in Ziva's settings: no API key, and no Claude Code or Codex install. This works on every Ziva plan, including free Hobby, and chat requests use your Claude or ChatGPT plan's limits instead of your Ziva usage. How to connect: &lt;a href="https://ziva.sh/docs/existing-subscriptions" rel="noopener noreferrer"&gt;https://ziva.sh/docs/existing-subscriptions&lt;/a&gt;&lt;/p&gt;

</description>
      <category>godot</category>
      <category>ai</category>
      <category>gamedev</category>
      <category>claudecode</category>
    </item>
    <item>
      <title>Is Godot Good for Digital Twins? An Honest 2026 Answer</title>
      <dc:creator>Ziva</dc:creator>
      <pubDate>Sat, 07 Nov 2026 15:04:50 +0000</pubDate>
      <link>https://dev.to/ziva/is-godot-good-for-digital-twins-an-honest-2026-answer-59ho</link>
      <guid>https://dev.to/ziva/is-godot-good-for-digital-twins-an-honest-2026-answer-59ho</guid>
      <description>&lt;p&gt;Originally published on ziva.sh: &lt;a href="https://ziva.sh/blogs/godot-digital-twin" rel="noopener noreferrer"&gt;https://ziva.sh/blogs/godot-digital-twin&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Yes, for the visual and interactive half of a digital twin: operator screens, training scenes, layout reviews and PLC test benches, with no license fees. No, if the twin has to be the source of truth for physics or process numbers. Godot's physics is built for games, it has no built-in industrial protocols, and it does not import STEP or JT CAD files. The best-known Godot factory simulator, Open Industry Project, archived its Godot version in October 2026 and moved to a browser app.&lt;/p&gt;

&lt;p&gt;If your company needs a twin built and checked against your drawings, &lt;a href="https://kenalabs.com/" rel="noopener noreferrer"&gt;Kena Labs&lt;/a&gt; does that: it builds 3D simulations from a client's drawings, photos, CAD, reports and sensor data and checks them against those sources. Kena Labs is a sister company of Ziva. &lt;a href="https://kenalabs.com/#contact" rel="noopener noreferrer"&gt;Book a demo with Kena Labs&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Ziva.sh publishes this page. Facts about Godot and other projects come from their own pages and repositories as of 7 November 2026.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;TL;DR&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Godot fits the presentation layer.&lt;/strong&gt; MIT license "for any purpose", strong UI, XR built in, C# and C++ (GDExtension) for your own integrations.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;It does not fit as the physics or process model.&lt;/strong&gt; Godot Jolt "is not able to make such guarantees" about determinism, and CAD has to be converted to glTF or FBX first.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;PLC connectivity is up to you.&lt;/strong&gt; No Modbus or OPC UA addon on the Asset Library today; a Siemens S7 plugin exists, and Modbus TCP is a short GDScript file.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Industrial Godot is real but small.&lt;/strong&gt; eSOL sells a Godot-based engine for industrial twins, W4 Games sells Godot enterprise support, and Open Industry Project left Godot in 2026.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What a digital twin needs, and what Godot covers
&lt;/h2&gt;

&lt;p&gt;A digital twin is a 3D model of a real asset that stays tied to it: live data from the plant, a model you can trust, and a way to act on what you see. Here is how Godot covers each part.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Need&lt;/th&gt;
&lt;th&gt;Godot today&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;License and cost&lt;/td&gt;
&lt;td&gt;"free and open source software released under the permissive MIT license", "free to use Godot Engine, for any purpose" (&lt;a href="https://godotengine.org/license/" rel="noopener noreferrer"&gt;license&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Operator UI and dashboards&lt;/td&gt;
&lt;td&gt;The UI system was made for games but "is also capable of handling complex UI applications and tools" (&lt;a href="https://godotengine.org/features/" rel="noopener noreferrer"&gt;features&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;XR training&lt;/td&gt;
&lt;td&gt;"Both OpenXR and WebXR support is built directly into the engine." (&lt;a href="https://godotengine.org/features/" rel="noopener noreferrer"&gt;features&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Your own integrations&lt;/td&gt;
&lt;td&gt;First-class C# on desktop and mobile, and C++ through GDExtension "without having to recompile the engine" (&lt;a href="https://godotengine.org/features/" rel="noopener noreferrer"&gt;features&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3D import&lt;/td&gt;
&lt;td&gt;glTF 2.0 (recommended), Blender &lt;code&gt;.blend&lt;/code&gt;, FBX, OBJ and COLLADA (&lt;a href="https://docs.godotengine.org/en/stable/tutorials/assets_pipeline/importing_3d_scenes/available_formats.html" rel="noopener noreferrer"&gt;formats&lt;/a&gt;). No STEP, IGES, JT or IFC: convert CAD to glTF or FBX first.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Physics&lt;/td&gt;
&lt;td&gt;Jolt is the default 3D engine for new projects, "developed by Jorrit Rouwe with a focus on games and VR applications" (&lt;a href="https://docs.godotengine.org/en/stable/tutorials/physics/using_jolt_physics.html" rel="noopener noreferrer"&gt;docs&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Determinism&lt;/td&gt;
&lt;td&gt;"Simulations in Godot Jolt may look deterministic, and may even happen to be deterministic, but this should not be relied upon if determinism is a hard requirement." (&lt;a href="https://github.com/godot-jolt/godot-jolt#what-about-determinism" rel="noopener noreferrer"&gt;Godot Jolt&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;PLC and plant data&lt;/td&gt;
&lt;td&gt;Nothing built in. The Asset Library has a &lt;a href="https://godotengine.org/asset-library/asset/4025" rel="noopener noreferrer"&gt;Siemens S7 PLC Plugin&lt;/a&gt; (MIT, version 0.1.0 for Godot 4.4) and no Modbus or OPC UA addon. Godot's &lt;code&gt;StreamPeerTCP&lt;/code&gt;, &lt;code&gt;WebSocketPeer&lt;/code&gt; and &lt;code&gt;HTTPRequest&lt;/code&gt; carry anything you write yourself.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The pattern that follows: let a PLC, a simulation tool or a historian own the numbers, and let Godot show them and take operator input. The same split is common in Unity and Unreal twins.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where Godot is a good choice
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;You deploy to many screens or customers.&lt;/strong&gt; No seats, royalties or runtime fees, and you can ship modified versions "even commercially and under a different license (including proprietary)" (&lt;a href="https://godotengine.org/license/" rel="noopener noreferrer"&gt;license&lt;/a&gt;). Unity Personal, by contrast, is "For gaming and entertainment applications only" (&lt;a href="https://unity.com/pricing" rel="noopener noreferrer"&gt;pricing&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;You want your own editor.&lt;/strong&gt; Godot's editor is built from the same UI nodes as its projects, so you can turn it into a layout or scenario tool. Open Industry Project's maintainer said in February 2024, after moving the project to Godot: "the fact that editor is built using the same UI as the games gives this project a lot of power" (&lt;a href="https://github.com/Open-Industry-Project/Open-Industry-Project-Godot/issues/26" rel="noopener noreferrer"&gt;issue #26&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Training and walkthroughs.&lt;/strong&gt; VR and AR training, onboarding and sales demos need a good-looking scene and input handling more than certified physics.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;PLC test benches and teaching rigs.&lt;/strong&gt; A conveyor cell driven by a real or soft PLC over Modbus TCP is a small, well-understood project.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Where it falls short
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Physics you can sign off on.&lt;/strong&gt; Game physics trades accuracy for speed, and Godot Jolt makes no determinism promise. If the twin must predict throughput, loads or robot behavior, use a tool built for it and import its results.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CAD and BIM.&lt;/strong&gt; Engineering formats need a conversion step (CAD to glTF or FBX, often through Blender), and large plants need mesh reduction. Unity, by comparison, says "70+ CAD and 3D file formats can be imported" (&lt;a href="https://unity.com/solutions/digital-twins" rel="noopener noreferrer"&gt;Unity&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Industrial protocols.&lt;/strong&gt; OPC UA, MQTT and most PLC drivers are libraries you wrap yourself. Open Industry Project's Godot version did it with &lt;a href="https://github.com/open62541/open62541" rel="noopener noreferrer"&gt;open62541&lt;/a&gt; for OPC UA and &lt;a href="https://github.com/libplctag/libplctag" rel="noopener noreferrer"&gt;libplctag&lt;/a&gt; for Modbus TCP and EtherNet/IP, inside a custom Godot build.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Ecosystem.&lt;/strong&gt; NVIDIA Omniverse and Isaac Sim come with OpenUSD pipelines, robot importers and ROS 2 bridges; Unity and Unreal have industry teams and partners. Godot's industrial ecosystem is a handful of companies and community projects.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What happened to Open Industry Project
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://www.openindustryproject.org/" rel="noopener noreferrer"&gt;Open Industry Project&lt;/a&gt; is the project most answers cite for Godot in industry. Its Godot repository described itself as a "Free and open-source warehouse/manufacturing development framework and simulator built on Godot", supported OPC UA, EtherNet/IP, Modbus TCP, Siemens S7, Beckhoff ADS, Universal Robots RTDE and MQTT, and has 859 stars.&lt;/p&gt;

&lt;p&gt;On GitHub that repository is now archived, with this notice: "This is the Godot version of Open Industry Project, and it is no longer maintained. Its successor runs in the browser and as a desktop app" (&lt;a href="https://github.com/Open-Industry-Project/Open-Industry-Project-Godot" rel="noopener noreferrer"&gt;repository&lt;/a&gt;). The successor, created on 19 October 2026, describes itself as a "Browser-based industrial automation simulator: conveyors, sensors, PLCs (TypeScript, three.js, Jolt)" (&lt;a href="https://github.com/Open-Industry-Project/Open-Industry-Project" rel="noopener noreferrer"&gt;repository&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;The maintainers have not published a reason in the repositories. The Godot version's repository shows what users ran into: the project shipped its own Godot fork, and a request for Linux support has been open since November 2025 (&lt;a href="https://github.com/Open-Industry-Project/Open-Industry-Project-Godot/issues/228" rel="noopener noreferrer"&gt;issue #228&lt;/a&gt;). The new version's site lists its price as "Free. No account, no licence key." If you were planning to build on the Godot version, start from the new one instead or treat the Godot code as reference.&lt;/p&gt;

&lt;h2&gt;
  
  
  Who uses Godot for industrial work today
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;eSOL eXRP.&lt;/strong&gt; A "Godot-based Real-time 3D Engine" for "3D simulations, digital twins, HMIs, and more in industrial sectors such as mobility, robotics, and manufacturing". Its listed uses include "Digital twins for production lines" and "Control simulation for conveyance machines", and eSOL says it "Jointly developed a 3D-LiDAR point cloud simulator" with Tadano Infrastructure Solutions using Godot (&lt;a href="https://www.esol.com/embedded/product/exrp.html" rel="noopener noreferrer"&gt;eSOL&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;W4 Games.&lt;/strong&gt; It offers "Direct involvement of Godot founders and core maintainers", calls itself "Your enterprise partner in the Godot Engine ecosystem" and sells professional services and "Enterprise-grade support for teams using Godot in production" (&lt;a href="https://www.w4games.com/" rel="noopener noreferrer"&gt;W4 Games&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Universities.&lt;/strong&gt; At GodotFest 2026, an LSU team presented a multiplayer VR and AR digital twin of the university's distillation columns built with Godot (&lt;a href="https://media.ccc.de/v/godotfest-26-37-building-a-multiplayer-network-for-digital-twins-in-vr-ar" rel="noopener noreferrer"&gt;talk&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Community PLC projects.&lt;/strong&gt; The &lt;a href="https://github.com/wepall-robotics/siemens-plugin" rel="noopener noreferrer"&gt;Siemens S7 PLC Plugin&lt;/a&gt; and conveyor-cell demos driven by CODESYS or OpenPLC, many of them built on the archived Open Industry Project.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Godot compared with the usual digital twin platforms
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Platform&lt;/th&gt;
&lt;th&gt;Non-game licensing, from its own pages&lt;/th&gt;
&lt;th&gt;Strongest at&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="https://godotengine.org/license/" rel="noopener noreferrer"&gt;Godot&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;MIT, "for any purpose"&lt;/td&gt;
&lt;td&gt;Free, customizable visualization and tools&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="https://unity.com/products/unity-industry" rel="noopener noreferrer"&gt;Unity Industry&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;"$4,950.00/yr per seat"; Unity Personal is "For gaming and entertainment applications only"&lt;/td&gt;
&lt;td&gt;CAD import, mobile and XR deployment&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="https://www.unrealengine.com/faq" rel="noopener noreferrer"&gt;Unreal Engine&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;Free for most non-game companies under $1 million in annual gross revenue; above that, $1,850 per seat a year, or a 5% royalty if you license an app that runs the engine&lt;/td&gt;
&lt;td&gt;Photorealistic large scenes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="https://www.nvidia.com/en-us/use-cases/industrial-facility-digital-twins/" rel="noopener noreferrer"&gt;NVIDIA Omniverse&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;"As of May 2026, Omniverse is freely available for both development and production use" (&lt;a href="https://docs.omniverse.nvidia.com/dev-overview/latest/common/NVIDIA_Omniverse_License_Agreement.html" rel="noopener noreferrer"&gt;license&lt;/a&gt;)&lt;/td&gt;
&lt;td&gt;OpenUSD pipelines and physics-based industrial twins&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="https://github.com/isaac-sim/IsaacSim" rel="noopener noreferrer"&gt;NVIDIA Isaac Sim&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;Apache 2.0 for the repository code; Omniverse Kit SDK and assets under other terms&lt;/td&gt;
&lt;td&gt;Robots, sensors and ROS 2&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;For the wider field, including Siemens, Azure Digital Twins, AWS IoT TwinMaker and open-source options, see our &lt;a href="https://ziva.sh/blogs/best-digital-twin-software" rel="noopener noreferrer"&gt;list of the best digital twin software in 2026&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Connecting Godot to a PLC
&lt;/h2&gt;

&lt;p&gt;Modbus TCP is the easiest place to start: a request is a 7-byte header plus a few bytes of function code and addresses, which GDScript can send over &lt;code&gt;StreamPeerTCP&lt;/code&gt;. We wrote and tested one: &lt;a href="https://ziva.sh/blogs/godot-modbus-tcp" rel="noopener noreferrer"&gt;How to connect Godot to a PLC over Modbus TCP&lt;/a&gt;. For Siemens S7-1200 and S7-1500 PLCs, the S7 plugin above reads and writes variables directly. For OPC UA, the realistic routes are a C# OPC UA library in a Godot .NET project or a GDExtension around open62541. Whichever you pick, poll on a timer rather than every frame, and treat a dropped connection as an error the operator sees, not a value that silently freezes.&lt;/p&gt;

&lt;p&gt;If you build the Godot side yourself, &lt;a href="https://ziva.sh/godot-ai" rel="noopener noreferrer"&gt;Ziva&lt;/a&gt;, an AI agent that works inside the Godot editor, can write the scenes, GDScript or C# and the UI for you, and run the scene to check it. It does not come with PLC drivers or validated physics. Ziva also works inside &lt;a href="https://ziva.sh/isaac-sim" rel="noopener noreferrer"&gt;NVIDIA Isaac Sim&lt;/a&gt; as a pilot for enterprise teams.&lt;/p&gt;

&lt;h2&gt;
  
  
  When to have a twin built instead
&lt;/h2&gt;

&lt;p&gt;If the twin has to match drawings and sensor data, the 3D is the smaller part of the work: collecting the drawings, checking dimensions and wiring the data take most of the time. &lt;a href="https://kenalabs.com/" rel="noopener noreferrer"&gt;Kena Labs&lt;/a&gt; builds simulations from that material. In its words, it turns "specs and photos into interactive 3D": "Drawings, photos, CAD, reports and sensor data become one scene", the scene is "Checked against the drawing, the sensor record or the case file", and it can be handed off as "OpenUSD for simulation, IFC for the plant model". Its published demos, on public-domain and sample material, include a &lt;a href="https://kenalabs.com/case-studies/pump-house/" rel="noopener noreferrer"&gt;1950 pump house rebuilt from one drawing&lt;/a&gt; and a &lt;a href="https://kenalabs.com/case-studies/parcel-line/" rel="noopener noreferrer"&gt;parcel line tested in 16 scenarios at once in NVIDIA Isaac Sim&lt;/a&gt;. Kena Labs is a sister company of Ziva. &lt;a href="https://kenalabs.com/#contact" rel="noopener noreferrer"&gt;Send Kena Labs your drawing or spec and book a demo&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  FAQ
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Can Godot be used for a digital twin?
&lt;/h3&gt;

&lt;p&gt;Yes, as the 3D, UI and interaction layer of a digital twin: operator screens, training scenes, layout reviews and PLC test benches. Godot is MIT licensed, so there are no seat or runtime fees, and it imports glTF, Blender, FBX, OBJ and COLLADA. It has no built-in OPC UA, Modbus or MQTT client, no native STEP or JT CAD import, and its physics is a game engine's physics: the Godot Jolt project says simulations should not be relied on to be deterministic. Teams that need an engineering-grade twin usually run the model outside Godot and use Godot to show it.&lt;/p&gt;

&lt;h3&gt;
  
  
  Is Godot good for industrial simulation?
&lt;/h3&gt;

&lt;p&gt;For visual, interactive simulations such as conveyor cells, warehouse layouts and training, it works, and eSOL sells a Godot-based engine, eXRP, for industrial digital twins and HMIs. For simulations whose numbers must be trusted, it is a weaker base than tools built for that job, such as Siemens Plant Simulation and Process Simulate or NVIDIA Isaac Sim, because physics is not guaranteed to be deterministic and industrial protocols are add-ons. Open Industry Project, the best-known Godot factory simulator, archived its Godot version in October 2026 and moved to a browser app.&lt;/p&gt;

&lt;h3&gt;
  
  
  Is Godot good for non-game applications?
&lt;/h3&gt;

&lt;p&gt;Often, yes. Godot's license lets you use it for any purpose, its UI system is, in the project's words, capable of handling complex UI applications and tools, and the editor itself is a Godot application. It suits apps that need real-time 2D or 3D, XR or custom editors. For plain forms-and-tables business software, a regular app framework is usually simpler.&lt;/p&gt;

&lt;h3&gt;
  
  
  Who offers enterprise support for Godot in industrial projects?
&lt;/h3&gt;

&lt;p&gt;W4 Games, which offers "Direct involvement of Godot founders and core maintainers", sells professional services and premium support for teams using Godot in production. eSOL sells eXRP, a Godot-based real-time 3D engine for industrial digital twins and HMIs, with engineering, consulting and support services.&lt;/p&gt;

</description>
      <category>godot</category>
      <category>gamedev</category>
      <category>digitaltwin</category>
      <category>iot</category>
    </item>
    <item>
      <title>How to Connect Godot to a PLC over Modbus TCP (Tested GDScript Client)</title>
      <dc:creator>Ziva</dc:creator>
      <pubDate>Sat, 07 Nov 2026 15:04:42 +0000</pubDate>
      <link>https://dev.to/ziva/how-to-connect-godot-to-a-plc-over-modbus-tcp-tested-gdscript-client-4nk9</link>
      <guid>https://dev.to/ziva/how-to-connect-godot-to-a-plc-over-modbus-tcp-tested-gdscript-client-4nk9</guid>
      <description>&lt;p&gt;Originally published on ziva.sh: &lt;a href="https://ziva.sh/blogs/godot-modbus-tcp" rel="noopener noreferrer"&gt;https://ziva.sh/blogs/godot-modbus-tcp&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Godot has no Modbus or OPC UA support built in, and the Godot Asset Library has no Modbus or OPC UA addon. Modbus TCP is simple enough that you do not need one: each request is a 7-byte header and a 5-byte command sent over TCP, which GDScript can do with &lt;code&gt;StreamPeerTCP&lt;/code&gt;. Below is a complete client for reading coils and holding registers and writing single coils and registers, a conveyor that runs while a PLC coil is on, and how we tested both. For Siemens S7 PLCs and OPC UA, see &lt;a href="https://ziva.sh/blogs/godot-modbus-tcp#siemens-s7-and-opc-ua" rel="noopener noreferrer"&gt;the other options&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;We tested this on Godot 4.7.2 on Linux, headless, against two independent Modbus TCP servers: &lt;a href="https://github.com/pymodbus-dev/pymodbus" rel="noopener noreferrer"&gt;pymodbus&lt;/a&gt; 3.16.2 and &lt;a href="https://github.com/sourceperl/pyModbusTCP" rel="noopener noreferrer"&gt;pyModbusTCP&lt;/a&gt; 0.3.1. All 15 checks passed on both on 7 November 2026. We did not test it against PLC hardware. Ziva.sh publishes this page.&lt;/p&gt;

&lt;h2&gt;
  
  
  The client
&lt;/h2&gt;

&lt;p&gt;Save this as &lt;code&gt;modbus_tcp_client.gd&lt;/code&gt;. It supports function codes 1 (read coils), 3 (read holding registers), 5 (write single coil) and 6 (write single register), one request at a time. Every call returns &lt;code&gt;null&lt;/code&gt; on failure and sets &lt;code&gt;last_error&lt;/code&gt;, so a lost PLC shows up as an error instead of a value that silently stops changing.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight gdscript"&gt;&lt;code&gt;&lt;span class="k"&gt;class_name&lt;/span&gt; &lt;span class="n"&gt;ModbusTcpClient&lt;/span&gt;
&lt;span class="k"&gt;extends&lt;/span&gt; &lt;span class="n"&gt;RefCounted&lt;/span&gt;
&lt;span class="c1"&gt;## Minimal Modbus TCP client (FC1, FC3, FC5, FC6), one request at a time.&lt;/span&gt;
&lt;span class="c1"&gt;## Every call returns null on failure and sets last_error; Modbus exception&lt;/span&gt;
&lt;span class="c1"&gt;## replies also set last_exception_code. Successful writes return true.&lt;/span&gt;
&lt;span class="c1"&gt;##&lt;/span&gt;
&lt;span class="c1"&gt;## Calls block the calling thread until the reply arrives or timeout_ms passes.&lt;/span&gt;
&lt;span class="c1"&gt;## A LAN PLC answers in a few ms; run the client on a Thread for slow links.&lt;/span&gt;

&lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="n"&gt;EXCEPTION_NAMES&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"Illegal Function"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"Illegal Data Address"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"Illegal Data Value"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"Server Device Failure"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"Server Device Busy"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"Gateway Path Unavailable"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="mi"&gt;11&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"Gateway Target Failed To Respond"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="n"&gt;unit_id&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
&lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="n"&gt;timeout_ms&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1000&lt;/span&gt;
&lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="n"&gt;last_error&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;""&lt;/span&gt;
&lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="n"&gt;last_exception_code&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
&lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="n"&gt;_tcp&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;StreamPeerTCP&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;new&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="n"&gt;_transaction_id&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;


&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="nf"&gt;connect_to_host&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;host&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;String&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;port&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;502&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;Variant&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;last_error&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;""&lt;/span&gt;
    &lt;span class="n"&gt;last_exception_code&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
    &lt;span class="n"&gt;_tcp&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;StreamPeerTCP&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;new&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="n"&gt;err&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;_tcp&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;connect_to_host&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;host&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;port&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;err&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="n"&gt;OK&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;_fail&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"connect to &lt;/span&gt;&lt;span class="si"&gt;%s&lt;/span&gt;&lt;span class="s2"&gt;:&lt;/span&gt;&lt;span class="si"&gt;%d&lt;/span&gt;&lt;span class="s2"&gt; failed: &lt;/span&gt;&lt;span class="si"&gt;%s&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;host&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;port&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;error_string&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;err&lt;/span&gt;&lt;span class="p"&gt;)])&lt;/span&gt;
    &lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="n"&gt;deadline&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Time&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;get_ticks_msec&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;timeout_ms&lt;/span&gt;
    &lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="n"&gt;Time&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;get_ticks_msec&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;deadline&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;_tcp&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;poll&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
        &lt;span class="k"&gt;match&lt;/span&gt; &lt;span class="n"&gt;_tcp&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;get_status&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
            &lt;span class="n"&gt;StreamPeerTCP&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;STATUS_CONNECTED&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
                &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="bp"&gt;true&lt;/span&gt;
            &lt;span class="n"&gt;StreamPeerTCP&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;STATUS_ERROR&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;StreamPeerTCP&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;STATUS_NONE&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
                &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;_fail&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"connect to &lt;/span&gt;&lt;span class="si"&gt;%s&lt;/span&gt;&lt;span class="s2"&gt;:&lt;/span&gt;&lt;span class="si"&gt;%d&lt;/span&gt;&lt;span class="s2"&gt; refused or failed"&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;host&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;port&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
        &lt;span class="n"&gt;OS&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;delay_msec&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;_fail_and_close&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"connect to &lt;/span&gt;&lt;span class="si"&gt;%s&lt;/span&gt;&lt;span class="s2"&gt;:&lt;/span&gt;&lt;span class="si"&gt;%d&lt;/span&gt;&lt;span class="s2"&gt; timed out after &lt;/span&gt;&lt;span class="si"&gt;%d&lt;/span&gt;&lt;span class="s2"&gt; ms"&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;host&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;port&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;timeout_ms&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;


&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="nf"&gt;read_coils&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;address&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;count&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;Variant&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="n"&gt;reply&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;_transact&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mh"&gt;0x01&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;address&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;count&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;ceili&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;count&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mf"&gt;8.0&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;reply&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="kt"&gt;null&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kt"&gt;null&lt;/span&gt;
    &lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="n"&gt;coils&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;Array&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="kt"&gt;bool&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[]&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;count&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;coils&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;append&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="n"&gt;reply&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt; &lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;coils&lt;/span&gt;


&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="nf"&gt;read_holding_registers&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;address&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;count&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;Variant&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="n"&gt;reply&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;_transact&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mh"&gt;0x03&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;address&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;count&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;count&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;reply&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="kt"&gt;null&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kt"&gt;null&lt;/span&gt;
    &lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="n"&gt;registers&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;Array&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[]&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;count&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;registers&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;reply&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;8&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;reply&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;registers&lt;/span&gt;


&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="nf"&gt;write_single_coil&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;address&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;on&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;bool&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;Variant&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kt"&gt;null&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;_transact&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mh"&gt;0x05&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;address&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mh"&gt;0xFF00&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;on&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="mh"&gt;0x0000&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="kt"&gt;null&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="bp"&gt;true&lt;/span&gt;


&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="nf"&gt;write_single_register&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;address&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;Variant&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kt"&gt;null&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;_transact&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mh"&gt;0x06&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;address&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="kt"&gt;null&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="bp"&gt;true&lt;/span&gt;


&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="nf"&gt;_transact&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;function_code&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;address&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;reply_size&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;Variant&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;last_error&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;""&lt;/span&gt;
    &lt;span class="n"&gt;last_exception_code&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;_tcp&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;get_status&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="n"&gt;StreamPeerTCP&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;STATUS_CONNECTED&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;_fail&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"not connected; call connect_to_host() first"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;address&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="ow"&gt;or&lt;/span&gt; &lt;span class="n"&gt;address&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mh"&gt;0xFFFF&lt;/span&gt; &lt;span class="ow"&gt;or&lt;/span&gt; &lt;span class="n"&gt;value&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="ow"&gt;or&lt;/span&gt; &lt;span class="n"&gt;value&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mh"&gt;0xFFFF&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;_fail&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"address &lt;/span&gt;&lt;span class="si"&gt;%d&lt;/span&gt;&lt;span class="s2"&gt; or value/count &lt;/span&gt;&lt;span class="si"&gt;%d&lt;/span&gt;&lt;span class="s2"&gt; is outside 0..65535"&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;address&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
    &lt;span class="n"&gt;_transaction_id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;_transaction_id&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt; &lt;span class="mh"&gt;0xFFFF&lt;/span&gt;
    &lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="n"&gt;pdu&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;PackedByteArray&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="n"&gt;function_code&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;address&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;address&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt; &lt;span class="mh"&gt;0xFF&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;value&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;value&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt; &lt;span class="mh"&gt;0xFF&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
    &lt;span class="c1"&gt;# MBAP header: transaction id, protocol id 0, byte count of unit id + PDU, unit id.&lt;/span&gt;
    &lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="n"&gt;mbap&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;PackedByteArray&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="n"&gt;_transaction_id&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;_transaction_id&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt; &lt;span class="mh"&gt;0xFF&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;pdu&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;size&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;unit_id&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
    &lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="n"&gt;err&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;_tcp&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;put_data&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;mbap&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;pdu&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;err&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="n"&gt;OK&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;_fail_and_close&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"send failed: &lt;/span&gt;&lt;span class="si"&gt;%s&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;error_string&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;err&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
    &lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="n"&gt;deadline&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Time&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;get_ticks_msec&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;timeout_ms&lt;/span&gt;
    &lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="n"&gt;header&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;_read_exact&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;deadline&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;header&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="kt"&gt;null&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kt"&gt;null&lt;/span&gt;
    &lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="n"&gt;length&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;header&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;8&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;header&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;header&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;8&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;header&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="n"&gt;_transaction_id&lt;/span&gt; &lt;span class="ow"&gt;or&lt;/span&gt; &lt;span class="n"&gt;header&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="ow"&gt;or&lt;/span&gt; &lt;span class="n"&gt;header&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; \
            &lt;span class="ow"&gt;or&lt;/span&gt; &lt;span class="n"&gt;header&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="n"&gt;unit_id&lt;/span&gt; &lt;span class="ow"&gt;or&lt;/span&gt; &lt;span class="n"&gt;length&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt; &lt;span class="ow"&gt;or&lt;/span&gt; &lt;span class="n"&gt;length&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;254&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;_fail_and_close&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"bad MBAP header &lt;/span&gt;&lt;span class="si"&gt;%s&lt;/span&gt;&lt;span class="s2"&gt; for transaction &lt;/span&gt;&lt;span class="si"&gt;%d&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;header&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;hex_encode&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt; &lt;span class="n"&gt;_transaction_id&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
    &lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="n"&gt;reply&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;_read_exact&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;length&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;deadline&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;reply&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="kt"&gt;null&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kt"&gt;null&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;reply&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;function_code&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="mh"&gt;0x80&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="n"&gt;last_exception_code&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;reply&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;_fail&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Modbus exception &lt;/span&gt;&lt;span class="si"&gt;%d&lt;/span&gt;&lt;span class="s2"&gt; (&lt;/span&gt;&lt;span class="si"&gt;%s&lt;/span&gt;&lt;span class="s2"&gt;) for function &lt;/span&gt;&lt;span class="si"&gt;%d&lt;/span&gt;&lt;span class="s2"&gt; at address &lt;/span&gt;&lt;span class="si"&gt;%d&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
                &lt;span class="n"&gt;reply&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;EXCEPTION_NAMES&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;reply&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="s2"&gt;"unknown code"&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;function_code&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;address&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
    &lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="n"&gt;valid&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;bool&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;reply&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;pdu&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;function_code&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="n"&gt;reply&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;size&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;reply_size&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;reply&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;reply_size&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;reply&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="n"&gt;function_code&lt;/span&gt; &lt;span class="ow"&gt;or&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="n"&gt;valid&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;_fail_and_close&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"unexpected reply &lt;/span&gt;&lt;span class="si"&gt;%s&lt;/span&gt;&lt;span class="s2"&gt; to request &lt;/span&gt;&lt;span class="si"&gt;%s&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;reply&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;hex_encode&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt; &lt;span class="n"&gt;pdu&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;hex_encode&lt;/span&gt;&lt;span class="p"&gt;()])&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;reply&lt;/span&gt;


&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="nf"&gt;_read_exact&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;byte_count&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;deadline&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;Variant&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="bp"&gt;true&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;_tcp&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;poll&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;_tcp&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;get_available_bytes&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="n"&gt;byte_count&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;_tcp&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;get_data&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;byte_count&lt;/span&gt;&lt;span class="p"&gt;)[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;_tcp&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;get_status&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="n"&gt;StreamPeerTCP&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;STATUS_CONNECTED&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;_fail&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"connection closed while waiting for &lt;/span&gt;&lt;span class="si"&gt;%d&lt;/span&gt;&lt;span class="s2"&gt; bytes"&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;byte_count&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;Time&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;get_ticks_msec&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="n"&gt;deadline&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="c1"&gt;# The late reply would desync the next transaction, so drop the socket.&lt;/span&gt;
            &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;_fail_and_close&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"timeout: no reply within &lt;/span&gt;&lt;span class="si"&gt;%d&lt;/span&gt;&lt;span class="s2"&gt; ms (connection closed)"&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;timeout_ms&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;OS&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;delay_msec&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kt"&gt;null&lt;/span&gt;


&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="nf"&gt;_fail_and_close&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;message&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;String&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;Variant&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;_tcp&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;disconnect_from_host&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;_fail&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;message&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;


&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="nf"&gt;_fail&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;message&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;String&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;Variant&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;last_error&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;message&lt;/span&gt;
    &lt;span class="n"&gt;push_error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"ModbusTcpClient: "&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;message&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kt"&gt;null&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Using it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight gdscript"&gt;&lt;code&gt;&lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="n"&gt;plc&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;ModbusTcpClient&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;new&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;plc&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;connect_to_host&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"192.168.0.10"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;502&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="kt"&gt;null&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;push_error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;plc&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;last_error&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt;
&lt;span class="n"&gt;plc&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;write_single_register&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1234&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;          &lt;span class="c1"&gt;# holding register 40001&lt;/span&gt;
&lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="n"&gt;regs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;plc&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;read_holding_registers&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;# [1234, ...]&lt;/span&gt;
&lt;span class="n"&gt;plc&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;write_single_coil&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="bp"&gt;true&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;               &lt;span class="c1"&gt;# coil 00004&lt;/span&gt;
&lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="n"&gt;coils&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;plc&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;read_coils&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;             &lt;span class="c1"&gt;# [false, false, false, true, ...]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Addresses are zero-based offsets: register 40001 in a PLC manual is offset 0, and coil 00001 is offset 0. If your values are off by one register, this is why.&lt;/p&gt;

&lt;h2&gt;
  
  
  A conveyor driven by a PLC coil
&lt;/h2&gt;

&lt;p&gt;This Node3D polls coil 0 every 50 ms and moves a &lt;code&gt;Box&lt;/code&gt; child along the belt while the coil is on. If the connection drops, it stops the belt rather than leaving it running on the last value it saw.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight gdscript"&gt;&lt;code&gt;&lt;span class="k"&gt;extends&lt;/span&gt; &lt;span class="n"&gt;Node3D&lt;/span&gt;
&lt;span class="c1"&gt;## Moves $Box along the belt while PLC coil `motor_coil` is on. Polls every 50 ms.&lt;/span&gt;

&lt;span class="err"&gt;@&lt;/span&gt;&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="n"&gt;plc_host&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"127.0.0.1"&lt;/span&gt;
&lt;span class="err"&gt;@&lt;/span&gt;&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="n"&gt;plc_port&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;502&lt;/span&gt;
&lt;span class="err"&gt;@&lt;/span&gt;&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="n"&gt;motor_coil&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
&lt;span class="err"&gt;@&lt;/span&gt;&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="n"&gt;belt_speed&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;0.5&lt;/span&gt; &lt;span class="c1"&gt;# meters per second&lt;/span&gt;
&lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="n"&gt;plc&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;ModbusTcpClient&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;new&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="n"&gt;motor_on&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="bp"&gt;false&lt;/span&gt;


&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="nf"&gt;_ready&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;void&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;plc&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;connect_to_host&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;plc_host&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;plc_port&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="kt"&gt;null&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt;
    &lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="n"&gt;timer&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Timer&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;new&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="n"&gt;timer&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;wait_time&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;0.05&lt;/span&gt;
    &lt;span class="n"&gt;timer&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;timeout&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;connect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;_poll_plc&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;bind&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;timer&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
    &lt;span class="n"&gt;add_child&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;timer&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;timer&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;start&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;


&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="nf"&gt;_poll_plc&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;timer&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Timer&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;void&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="n"&gt;coils&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;plc&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;read_coils&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;motor_coil&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;coils&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="kt"&gt;null&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;timer&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;stop&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="c1"&gt;# Comms lost: stop the belt; the client already logged why.&lt;/span&gt;
        &lt;span class="n"&gt;motor_on&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="bp"&gt;false&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt;
    &lt;span class="n"&gt;motor_on&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;coils&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;


&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="nf"&gt;_physics_process&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;delta&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;float&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;void&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;motor_on&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="o"&gt;$&lt;/span&gt;&lt;span class="n"&gt;Box&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;position&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="n"&gt;belt_speed&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;delta&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Polling on a 50 ms &lt;code&gt;Timer&lt;/code&gt; keeps PLC traffic independent of frame rate. Each call blocks until the reply arrives; a PLC on the local network answers in a few milliseconds, but a dead one blocks for up to &lt;code&gt;timeout_ms&lt;/code&gt;, so keep the timeout short or move polling to a &lt;code&gt;Thread&lt;/code&gt; on slow links.&lt;/p&gt;

&lt;h2&gt;
  
  
  How we tested it
&lt;/h2&gt;

&lt;p&gt;We ran a Modbus TCP server with 16 coils and 16 holding registers on 127.0.0.1, then a headless Godot script that writes and reads back registers and coils, reads past the end of the data (which must return Modbus exception 2, Illegal Data Address), checks the connection still works after the exception, checks a 200 ms timeout against a server that never answers, and runs the conveyor scene for a few frames with coil 0 on and then off.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python3 &lt;span class="nt"&gt;-m&lt;/span&gt; venv /tmp/modbus-venv
/tmp/modbus-venv/bin/pip &lt;span class="nb"&gt;install &lt;/span&gt;&lt;span class="nv"&gt;pyModbusTCP&lt;/span&gt;&lt;span class="o"&gt;==&lt;/span&gt;0.3.1
/tmp/modbus-venv/bin/python &lt;span class="nt"&gt;-c&lt;/span&gt; &lt;span class="s2"&gt;"from pyModbusTCP.server import DataBank, ModbusServer; ModbusServer(host='127.0.0.1', port=5021, data_bank=DataBank(coils_size=16, d_inputs_size=16, h_regs_size=16, i_regs_size=16)).start()"&lt;/span&gt; &amp;amp;
godot &lt;span class="nt"&gt;--headless&lt;/span&gt; &lt;span class="nt"&gt;--path&lt;/span&gt; &lt;span class="nb"&gt;.&lt;/span&gt; &lt;span class="nt"&gt;--import&lt;/span&gt;
godot &lt;span class="nt"&gt;--headless&lt;/span&gt; &lt;span class="nt"&gt;--path&lt;/span&gt; &lt;span class="nb"&gt;.&lt;/span&gt; &lt;span class="nt"&gt;--script&lt;/span&gt; res://test_modbus.gd &lt;span class="nt"&gt;--&lt;/span&gt; &lt;span class="nt"&gt;--port&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;5021
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The project holds a minimal &lt;code&gt;project.godot&lt;/code&gt;, &lt;code&gt;modbus_tcp_client.gd&lt;/code&gt;, &lt;code&gt;conveyor.gd&lt;/code&gt; and &lt;code&gt;conveyor.tscn&lt;/code&gt; (a Node3D with &lt;code&gt;conveyor.gd&lt;/code&gt; attached and a &lt;code&gt;MeshInstance3D&lt;/code&gt; child named &lt;code&gt;Box&lt;/code&gt;), plus this test script:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;test_modbus.gd&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight gdscript"&gt;&lt;code&gt;&lt;span class="k"&gt;extends&lt;/span&gt; &lt;span class="n"&gt;SceneTree&lt;/span&gt;
&lt;span class="c1"&gt;## Headless test: godot --headless --path . --script res://test_modbus.gd -- --port=5020&lt;/span&gt;
&lt;span class="c1"&gt;## Expects a server with 16 coils and 16 holding registers (addresses 0..15) on 127.0.0.1.&lt;/span&gt;

&lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="n"&gt;failures&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;


&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="nf"&gt;check&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;String&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ok&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;bool&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;detail&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Variant&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;""&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;void&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="nb"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="si"&gt;%s&lt;/span&gt;&lt;span class="s2"&gt; &lt;/span&gt;&lt;span class="si"&gt;%s&lt;/span&gt;&lt;span class="s2"&gt; &lt;/span&gt;&lt;span class="si"&gt;%s&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"PASS"&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;ok&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="s2"&gt;"FAIL"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;detail&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="n"&gt;ok&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;failures&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;


&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="nf"&gt;_initialize&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;void&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="n"&gt;port&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;5020&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;arg&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;OS&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;get_cmdline_user_args&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;arg&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;begins_with&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"--port="&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
            &lt;span class="n"&gt;port&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;arg&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;trim_prefix&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"--port="&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
    &lt;span class="nb"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Godot &lt;/span&gt;&lt;span class="si"&gt;%s&lt;/span&gt;&lt;span class="s2"&gt;, server 127.0.0.1:&lt;/span&gt;&lt;span class="si"&gt;%d&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Engine&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;get_version_info&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;string&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;port&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
    &lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="n"&gt;plc&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;ModbusTcpClient&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;new&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="n"&gt;check&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"connect"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;plc&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;connect_to_host&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"127.0.0.1"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;port&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="bp"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;plc&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;last_error&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="n"&gt;check&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"FC6 write register 0 = 1234"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;plc&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;write_single_register&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1234&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="bp"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;plc&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;last_error&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;check&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"FC6 write register 1 = 0xBEEF"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;plc&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;write_single_register&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mh"&gt;0xBEEF&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="bp"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;plc&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;last_error&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="n"&gt;regs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;plc&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;read_holding_registers&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;check&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"FC3 read registers 0..1 == [1234, 48879]"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;regs&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1234&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mh"&gt;0xBEEF&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;regs&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="n"&gt;check&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"FC5 write coil 3 = true"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;plc&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;write_single_coil&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="bp"&gt;true&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="bp"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;plc&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;last_error&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="n"&gt;coils&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;plc&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;read_coils&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;check&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"FC1 read coils 0..7 has only coil 3 on"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;coils&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="bp"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="bp"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="bp"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="bp"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="bp"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="bp"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="bp"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="bp"&gt;false&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;coils&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;plc&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;write_single_coil&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="bp"&gt;false&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;coils&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;plc&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;read_coils&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;16&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;check&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"FC5 coil 3 = false then FC1 read coils 0..15 all off"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;coils&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="kt"&gt;null&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;coils&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;size&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;16&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="n"&gt;coils&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;has&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;true&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;coils&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="n"&gt;bad&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;plc&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;read_holding_registers&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;check&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"FC3 read register 100 returns exception 2"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;bad&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="kt"&gt;null&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;plc&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;last_exception_code&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;plc&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;last_error&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;bad&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;plc&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;read_coils&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;16&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;check&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"FC1 read coil 16 returns exception 2"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;bad&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="kt"&gt;null&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;plc&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;last_exception_code&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;plc&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;last_error&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;regs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;plc&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;read_holding_registers&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;check&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"connection still usable after exception"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;regs&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1234&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;regs&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="n"&gt;silent&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;TCPServer&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;new&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="n"&gt;silent&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;listen&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;5099&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"127.0.0.1"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="n"&gt;mute_plc&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;ModbusTcpClient&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;new&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="n"&gt;mute_plc&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;timeout_ms&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;200&lt;/span&gt;
    &lt;span class="n"&gt;mute_plc&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;connect_to_host&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"127.0.0.1"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;5099&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="n"&gt;started&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Time&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;get_ticks_msec&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;mute_plc&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;read_coils&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="n"&gt;elapsed&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Time&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;get_ticks_msec&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;started&lt;/span&gt;
    &lt;span class="n"&gt;check&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"timeout on silent server after ~200 ms"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="kt"&gt;null&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;mute_plc&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;last_error&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;begins_with&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"timeout"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;elapsed&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="mi"&gt;200&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;elapsed&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;400&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="si"&gt;%d&lt;/span&gt;&lt;span class="s2"&gt; ms: &lt;/span&gt;&lt;span class="si"&gt;%s&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;elapsed&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;mute_plc&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;last_error&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
    &lt;span class="n"&gt;check&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"call after timeout reports not connected"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;mute_plc&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;read_coils&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="kt"&gt;null&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;mute_plc&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;last_error&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;begins_with&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"not connected"&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;mute_plc&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;last_error&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;silent&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;stop&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="n"&gt;check&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"connect refused reports error"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ModbusTcpClient&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;new&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;connect_to_host&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"127.0.0.1"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;5098&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="kt"&gt;null&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="n"&gt;conveyor&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Node3D&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;load&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"res://conveyor.tscn"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;instantiate&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="n"&gt;conveyor&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;plc_port&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;port&lt;/span&gt;
    &lt;span class="n"&gt;root&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;add_child&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;conveyor&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;plc&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;write_single_coil&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="bp"&gt;true&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;await&lt;/span&gt; &lt;span class="n"&gt;create_timer&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;0.5&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;timeout&lt;/span&gt;
    &lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="n"&gt;moved_x&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;float&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;conveyor&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;get_node&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Box"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;position&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;
    &lt;span class="n"&gt;check&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"conveyor box moves while coil 0 is on"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;moved_x&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mf"&gt;0.15&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"x=&lt;/span&gt;&lt;span class="si"&gt;%.3f&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;moved_x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;plc&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;write_single_coil&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="bp"&gt;false&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;await&lt;/span&gt; &lt;span class="n"&gt;create_timer&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;0.2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;timeout&lt;/span&gt;
    &lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="n"&gt;stopped_x&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;float&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;conveyor&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;get_node&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Box"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;position&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;
    &lt;span class="n"&gt;await&lt;/span&gt; &lt;span class="n"&gt;create_timer&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;0.3&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;timeout&lt;/span&gt;
    &lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="n"&gt;final_x&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;float&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;conveyor&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;get_node&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Box"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;position&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;
    &lt;span class="n"&gt;check&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"conveyor box stops when coil 0 is off"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;is_equal_approx&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;stopped_x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;final_x&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="s2"&gt;"x=&lt;/span&gt;&lt;span class="si"&gt;%.3f&lt;/span&gt;&lt;span class="s2"&gt; then &lt;/span&gt;&lt;span class="si"&gt;%.3f&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;stopped_x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;final_x&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;

    &lt;span class="nb"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"RESULT: &lt;/span&gt;&lt;span class="si"&gt;%s&lt;/span&gt;&lt;span class="s2"&gt; (&lt;/span&gt;&lt;span class="si"&gt;%d&lt;/span&gt;&lt;span class="s2"&gt; failures)"&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"PASS"&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;failures&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="s2"&gt;"FAIL"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;failures&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
    &lt;span class="n"&gt;quit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;failures&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The PASS and FAIL lines against pyModbusTCP 0.3.1 are below. The full log also has &lt;code&gt;ERROR: ModbusTcpClient: ...&lt;/code&gt; lines from the checks that expect an error; those are expected. pymodbus 3.16.2 passed the same 15 checks, with the timeout at 200 ms instead of 201 ms.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Godot 4.7.2-stable (arch_linux), server 127.0.0.1:5021
PASS connect
PASS FC6 write register 0 = 1234
PASS FC6 write register 1 = 0xBEEF
PASS FC3 read registers 0..1 == [1234, 48879] [1234, 48879]
PASS FC5 write coil 3 = true
PASS FC1 read coils 0..7 has only coil 3 on [false, false, false, true, false, false, false, false]
PASS FC5 coil 3 = false then FC1 read coils 0..15 all off [false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false]
PASS FC3 read register 100 returns exception 2 Modbus exception 2 (Illegal Data Address) for function 3 at address 100
PASS FC1 read coil 16 returns exception 2 Modbus exception 2 (Illegal Data Address) for function 1 at address 16
PASS connection still usable after exception [1234]
PASS timeout on silent server after ~200 ms 201 ms: timeout: no reply within 200 ms (connection closed)
PASS call after timeout reports not connected not connected; call connect_to_host() first
PASS connect refused reports error
PASS conveyor box moves while coil 0 is on x=0.183
PASS conveyor box stops when coil 0 is off x=0.208 then 0.208
RESULT: PASS (0 failures)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With no server listening, the same script exits with code 1 and FAIL lines, so a broken setup cannot pass silently.&lt;/p&gt;

&lt;h2&gt;
  
  
  Limits
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Function codes 1, 3, 5 and 6 only. Discrete inputs (2), input registers (4) and multiple writes (15, 16) need a few more lines each.&lt;/li&gt;
&lt;li&gt;No automatic reconnect: after a timeout the socket is closed and you call &lt;code&gt;connect_to_host&lt;/code&gt; again.&lt;/li&gt;
&lt;li&gt;No TLS or authentication. Keep plain Modbus TCP on an isolated control network.&lt;/li&gt;
&lt;li&gt;32-bit values split across two registers are not decoded; word order differs between PLC vendors.&lt;/li&gt;
&lt;li&gt;It does not work in web exports. Godot's &lt;a href="https://docs.godotengine.org/en/stable/tutorials/export/exporting_for_web.html" rel="noopener noreferrer"&gt;web export docs&lt;/a&gt; say: "Low-level networking is not implemented due to lacking support in browsers."&lt;/li&gt;
&lt;li&gt;Tested on Linux desktop only, not on PLC hardware.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Siemens S7 and OPC UA
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Siemens S7.&lt;/strong&gt; The &lt;a href="https://godotengine.org/asset-library/asset/4025" rel="noopener noreferrer"&gt;Siemens S7 PLC Plugin&lt;/a&gt; on the Asset Library (MIT, version 0.1.0 for Godot 4.4) says it connects to S7-300, S7-400, S7-1200 and S7-1500 PLCs and reads and writes variables directly. We did not test it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;OPC UA in C#.&lt;/strong&gt; The OPC Foundation's &lt;a href="https://github.com/OPCFoundation/UA-.NETStandard" rel="noopener noreferrer"&gt;UA .NET Standard&lt;/a&gt; stack, "The official OPC Foundation reference implementation of OPC UA for .NET", runs on .NET 8, which Godot's .NET build uses, and Godot's docs say "NuGet packages can be installed and used with Godot, as with any C# project." C# projects cannot be exported to the web.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;OPC UA in a GDExtension.&lt;/strong&gt; Wrap &lt;a href="https://github.com/open62541/open62541" rel="noopener noreferrer"&gt;open62541&lt;/a&gt;, a C implementation of OPC UA under MPL 2.0. Open Industry Project's &lt;a href="https://github.com/Open-Industry-Project/oip-comms" rel="noopener noreferrer"&gt;oip-comms&lt;/a&gt; did this for its Godot version, which is now archived and no longer maintained.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A bridge process.&lt;/strong&gt; Run an OPC UA client such as Node-RED or Python's asyncua next to Godot and pass values over a WebSocket. This is the only route that also works in a web export.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We tested none of the OPC UA routes. For whether Godot is the right engine for the whole twin, see &lt;a href="https://ziva.sh/blogs/godot-digital-twin" rel="noopener noreferrer"&gt;Is Godot good for digital twins?&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Need the whole twin built?
&lt;/h2&gt;

&lt;p&gt;A PLC link is one piece. If you need a plant, line or cell rebuilt from your drawings and checked against them, &lt;a href="https://kenalabs.com/" rel="noopener noreferrer"&gt;Kena Labs&lt;/a&gt; builds 3D simulations from a client's drawings, photos, CAD, reports and sensor data and checks them against those sources; one of its demos is a &lt;a href="https://kenalabs.com/case-studies/parcel-line/" rel="noopener noreferrer"&gt;parcel line tested in 16 scenarios at once&lt;/a&gt;. Kena Labs is a sister company of Ziva. &lt;a href="https://kenalabs.com/#contact" rel="noopener noreferrer"&gt;Book a demo with Kena Labs&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;If you are building the Godot side yourself, &lt;a href="https://ziva.sh/godot-ai" rel="noopener noreferrer"&gt;Ziva&lt;/a&gt;, an AI agent inside the Godot editor, can write this kind of client and scene code for you and run the scene to check it.&lt;/p&gt;

&lt;h2&gt;
  
  
  FAQ
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Can Godot connect to a PLC over Modbus TCP or OPC UA?
&lt;/h3&gt;

&lt;p&gt;Yes, but neither is built in. Modbus TCP is a small binary protocol over TCP, so a GDScript client on StreamPeerTCP is enough; ours reads coils (function 1) and holding registers (function 3) and writes single coils and registers (functions 5 and 6), and it passed every check against two independent Modbus servers on Godot 4.7.2. For OPC UA you need a library: the OPC Foundation's .NET stack in a Godot .NET project, a GDExtension around open62541, or a separate bridge process that passes values to Godot.&lt;/p&gt;

&lt;h3&gt;
  
  
  Is there a Modbus or OPC UA addon for Godot?
&lt;/h3&gt;

&lt;p&gt;Not on the Godot Asset Library as of November 2026; searches for Modbus and OPC UA return nothing relevant. The Asset Library does have a Siemens S7 PLC Plugin (MIT, version 0.1.0 for Godot 4.4) that reads and writes S7-300, S7-400, S7-1200 and S7-1500 variables. Open Industry Project's oip-comms GDExtension supported OPC UA and Modbus TCP, but it is archived and no longer maintained.&lt;/p&gt;

&lt;h3&gt;
  
  
  Does Modbus TCP work in a Godot web export?
&lt;/h3&gt;

&lt;p&gt;No. Godot's web export docs say low-level networking is not implemented because browsers do not support it; only HTTP, WebSocket client and WebRTC work. For a browser-based HMI or twin, run a bridge that reads the PLC and sends values to Godot over a WebSocket.&lt;/p&gt;

</description>
      <category>godot</category>
      <category>gamedev</category>
      <category>iot</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>How to simulate keyboard and mouse input in GUT and GdUnit4 (tested on Godot 4.7.2)</title>
      <dc:creator>Ziva</dc:creator>
      <pubDate>Sat, 07 Nov 2026 06:42:49 +0000</pubDate>
      <link>https://dev.to/ziva/how-to-simulate-keyboard-and-mouse-input-in-gut-and-gdunit4-tested-on-godot-472-4c51</link>
      <guid>https://dev.to/ziva/how-to-simulate-keyboard-and-mouse-input-in-gut-and-gdunit4-tested-on-godot-472-4c51</guid>
      <description>&lt;p&gt;In GUT, queue input on a &lt;code&gt;GutInputSender&lt;/code&gt; aimed at &lt;code&gt;Input&lt;/code&gt; and &lt;code&gt;await&lt;/code&gt; its &lt;code&gt;idle&lt;/code&gt; signal before you assert; in GdUnit4, call the scene runner's &lt;code&gt;simulate_key_*&lt;/code&gt;, &lt;code&gt;simulate_action_*&lt;/code&gt; and &lt;code&gt;simulate_mouse_button_*&lt;/code&gt; methods, wait, and &lt;code&gt;await runner.await_input_processed()&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Ziva.sh publishes this page and makes Ziva. We ran every test and command on this page on 7 November 2026 with Godot 4.7.2 on Linux, GUT 9.7.1 and GdUnit4 6.2.3, the latest releases that day, on the public &lt;a href="https://github.com/ziva-sh/ziva-godot-sample" rel="noopener noreferrer"&gt;Star Catcher sample&lt;/a&gt;, a 2D game where the arrow keys move a square into stars. Method names come from the installed addons' source code.&lt;/p&gt;

&lt;h2&gt;
  
  
  GUT
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://gut.readthedocs.io/en/latest/class_ref/class_gutinputsender.html" rel="noopener noreferrer"&gt;GUT's GutInputSender&lt;/a&gt; sends input events to receivers. With &lt;code&gt;Input&lt;/code&gt; as the receiver, GUT 9.7.1 passes each event to &lt;code&gt;Input.parse_input_event&lt;/code&gt;, so the game sees it like hardware input. Chained calls are queued and played back in real time, and &lt;code&gt;await _sender.idle&lt;/code&gt; waits until the queue is empty.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight gdscript"&gt;&lt;code&gt;&lt;span class="c1"&gt;# res://test/test_input.gd&lt;/span&gt;
&lt;span class="k"&gt;extends&lt;/span&gt; &lt;span class="n"&gt;GutTest&lt;/span&gt;

&lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="n"&gt;_sender&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;GutInputSender&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;new&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Input&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;


&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="nf"&gt;after_each&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;void&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;_sender&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;release_all&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="n"&gt;_sender&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;clear&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;


&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="nf"&gt;test_holding_right_arrow_collects_a_star&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;void&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="n"&gt;main&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Node&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;add_child_autofree&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;load&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"res://main.tscn"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;instantiate&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
    &lt;span class="n"&gt;_sender&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;key_down&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;KEY_RIGHT&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;hold_for&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;1.2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;wait&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;0.3&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;await&lt;/span&gt; &lt;span class="n"&gt;_sender&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;idle&lt;/span&gt;
    &lt;span class="n"&gt;assert_eq&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;main&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;get_node&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"HUD/ScoreLabel"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"Score: 1"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;


&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="nf"&gt;test_holding_ui_right_action_collects_a_star&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;void&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="n"&gt;main&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Node&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;add_child_autofree&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;load&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"res://main.tscn"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;instantiate&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
    &lt;span class="n"&gt;_sender&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;action_down&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"ui_right"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;hold_for&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;1.2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;wait&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;0.3&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;await&lt;/span&gt; &lt;span class="n"&gt;_sender&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;idle&lt;/span&gt;
    &lt;span class="n"&gt;assert_eq&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;main&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;get_node&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"HUD/ScoreLabel"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"Score: 1"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;


&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="nf"&gt;test_clicking_a_button_emits_pressed&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;void&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="n"&gt;button&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Button&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;add_child_autofree&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Button&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;new&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
    &lt;span class="n"&gt;button&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;position&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kt"&gt;Vector2&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;300&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;button&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;size&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kt"&gt;Vector2&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;40&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;watch_signals&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;button&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;_sender&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;mouse_left_click_at&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;Vector2&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;350&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;220&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
    &lt;span class="n"&gt;await&lt;/span&gt; &lt;span class="n"&gt;_sender&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;idle&lt;/span&gt;
    &lt;span class="n"&gt;assert_signal_emitted&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;button&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"pressed"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;hold_for(1.2)&lt;/code&gt; sends the matching release 1.2 seconds after the press, and &lt;code&gt;wait(0.3)&lt;/code&gt; gives the game time to react; both also take a frame count as a string such as &lt;code&gt;"10f"&lt;/code&gt;. GutInputSender also has &lt;code&gt;key_up&lt;/code&gt;, &lt;code&gt;action_up&lt;/code&gt;, &lt;code&gt;mouse_left_button_down&lt;/code&gt;, &lt;code&gt;mouse_left_button_up&lt;/code&gt;, &lt;code&gt;mouse_right_button_down&lt;/code&gt;, &lt;code&gt;mouse_right_button_up&lt;/code&gt;, &lt;code&gt;mouse_double_click&lt;/code&gt;, &lt;code&gt;mouse_motion&lt;/code&gt;, &lt;code&gt;mouse_relative_motion&lt;/code&gt;, &lt;code&gt;wait_frames&lt;/code&gt; and &lt;code&gt;hold_frames&lt;/code&gt;. GUT's docs say to call &lt;code&gt;release_all()&lt;/code&gt; "between each test when using &lt;code&gt;Input&lt;/code&gt; as a receiver" and &lt;code&gt;clear()&lt;/code&gt; "so that state does not leak between tests", which is what &lt;code&gt;after_each&lt;/code&gt; does here.&lt;/p&gt;

&lt;p&gt;Under &lt;code&gt;xvfb-run&lt;/code&gt; with &lt;code&gt;-gcompact_mode&lt;/code&gt;, all three tests passed. Headless, the two keyboard tests passed and the click test failed; see &lt;a href="https://ziva.sh/blogs/godot-gut-gdunit4-simulate-input#pitfalls" rel="noopener noreferrer"&gt;Pitfalls&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  GdUnit4
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://godot-gdunit-labs.github.io/gdUnit4/latest/advanced_testing/scene_runner/keys/" rel="noopener noreferrer"&gt;GdUnit4's scene runner&lt;/a&gt; loads a scene, or wraps a node you pass it, and feeds simulated input through &lt;code&gt;Input.parse_input_event&lt;/code&gt;. GdUnit4's docs say "you must wait at least one frame cycle after simulating inputs" and point to &lt;code&gt;await runner.await_input_processed()&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight gdscript"&gt;&lt;code&gt;&lt;span class="c1"&gt;# res://test/test_input.gd&lt;/span&gt;
&lt;span class="k"&gt;extends&lt;/span&gt; &lt;span class="n"&gt;GdUnitTestSuite&lt;/span&gt;


&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="nf"&gt;test_holding_right_arrow_collects_a_star&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;void&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="n"&gt;runner&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;scene_runner&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"res://main.tscn"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;runner&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;simulate_key_press&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;KEY_RIGHT&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;await&lt;/span&gt; &lt;span class="n"&gt;await_millis&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1200&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;runner&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;simulate_key_release&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;KEY_RIGHT&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;await&lt;/span&gt; &lt;span class="n"&gt;runner&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;await_input_processed&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="n"&gt;assert_str&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;runner&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;find_child&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"ScoreLabel"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;is_equal&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Score: 1"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;


&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="nf"&gt;test_holding_ui_right_action_collects_a_star&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;void&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="n"&gt;runner&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;scene_runner&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"res://main.tscn"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;runner&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;simulate_action_press&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"ui_right"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;await&lt;/span&gt; &lt;span class="n"&gt;await_millis&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1200&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;runner&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;simulate_action_release&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"ui_right"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;await&lt;/span&gt; &lt;span class="n"&gt;runner&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;await_input_processed&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="n"&gt;assert_str&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;runner&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;find_child&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"ScoreLabel"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;is_equal&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Score: 1"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;


&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="nf"&gt;test_clicking_a_button_emits_pressed&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;void&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="n"&gt;button&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Button&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;auto_free&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Button&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;new&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
    &lt;span class="n"&gt;button&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;position&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kt"&gt;Vector2&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;300&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;button&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;size&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kt"&gt;Vector2&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;40&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="n"&gt;runner&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;scene_runner&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;button&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;monitor_signals&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;button&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="bp"&gt;false&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;runner&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;set_mouse_position&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;Vector2&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;350&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;220&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
    &lt;span class="n"&gt;runner&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;simulate_mouse_button_pressed&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;MOUSE_BUTTON_LEFT&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;await&lt;/span&gt; &lt;span class="n"&gt;runner&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;await_input_processed&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="n"&gt;await&lt;/span&gt; &lt;span class="n"&gt;assert_signal&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;button&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;is_emitted&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"pressed"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;GdUnit4 6.2.3 has three methods for each kind of input:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Input&lt;/th&gt;
&lt;th&gt;Press and release&lt;/th&gt;
&lt;th&gt;Press only&lt;/th&gt;
&lt;th&gt;Release&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Key&lt;/td&gt;
&lt;td&gt;&lt;code&gt;simulate_key_pressed(KEY_ENTER)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;simulate_key_press(KEY_SHIFT)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;simulate_key_release(KEY_SHIFT)&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Mouse button&lt;/td&gt;
&lt;td&gt;&lt;code&gt;simulate_mouse_button_pressed(MOUSE_BUTTON_LEFT)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;simulate_mouse_button_press(MOUSE_BUTTON_LEFT)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;simulate_mouse_button_release(MOUSE_BUTTON_LEFT)&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Input action&lt;/td&gt;
&lt;td&gt;&lt;code&gt;simulate_action_pressed("ui_accept")&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;simulate_action_press("ui_right")&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;simulate_action_release("ui_right")&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;GdUnit4 moves the mouse with &lt;code&gt;set_mouse_position(position)&lt;/code&gt; and &lt;code&gt;simulate_mouse_move(position)&lt;/code&gt;, or gradually with &lt;code&gt;simulate_mouse_move_relative&lt;/code&gt; and &lt;code&gt;simulate_mouse_move_absolute&lt;/code&gt;. In GdUnit4 6.2.3, &lt;code&gt;simulate_key_pressed&lt;/code&gt; waits one frame between the press and the release, so &lt;code&gt;await&lt;/code&gt; it, while &lt;code&gt;simulate_action_pressed&lt;/code&gt; and &lt;code&gt;simulate_mouse_button_pressed&lt;/code&gt; press and release within the same call. For a key combination, GdUnit4's &lt;a href="https://godot-gdunit-labs.github.io/gdUnit4/latest/advanced_testing/scene_runner/keys/" rel="noopener noreferrer"&gt;key docs&lt;/a&gt; say to hold each key with &lt;code&gt;simulate_key_press&lt;/code&gt;, such as &lt;code&gt;KEY_CTRL&lt;/code&gt; then &lt;code&gt;KEY_C&lt;/code&gt;, because the &lt;code&gt;shift&lt;/code&gt; and &lt;code&gt;control&lt;/code&gt; arguments are deprecated and "will be removed in v7.0".&lt;/p&gt;

&lt;p&gt;Under &lt;code&gt;xvfb-run&lt;/code&gt;, GdUnit4 6.2.3 passed all three tests. GdUnit4's master branch, the unreleased 7.0.0 (commit 2cc420a), also passed all three with &lt;code&gt;--headless&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Outside a test framework
&lt;/h2&gt;

&lt;p&gt;Godot itself has two ways to fake input from code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight gdscript"&gt;&lt;code&gt;&lt;span class="c1"&gt;# A key event: _input() sees it, and the ui_right action mapped to that key becomes pressed.&lt;/span&gt;
&lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="n"&gt;key&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;InputEventKey&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;new&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;keycode&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;KEY_RIGHT&lt;/span&gt;
&lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;pressed&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="bp"&gt;true&lt;/span&gt;
&lt;span class="n"&gt;Input&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;parse_input_event&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;# An action only: Input.is_action_pressed("ui_right") is true, but _input() is never called.&lt;/span&gt;
&lt;span class="n"&gt;Input&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;action_press&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"ui_right"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;Input&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;action_release&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"ui_right"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In our headless Godot 4.7.2 run, a node's &lt;code&gt;_input&lt;/code&gt; printed the parsed key's press and release and nothing for &lt;code&gt;action_press&lt;/code&gt;, and &lt;code&gt;Input.is_action_pressed("ui_right")&lt;/code&gt; was true after both. Godot's &lt;a href="https://docs.godotengine.org/en/stable/classes/class_input.html" rel="noopener noreferrer"&gt;Input docs&lt;/a&gt; say &lt;code&gt;parse_input_event&lt;/code&gt; "Also generates Node._input() calls" and that &lt;code&gt;action_press&lt;/code&gt; "will not cause any Node._input() calls". To release a parsed key, send another &lt;code&gt;InputEventKey&lt;/code&gt; with &lt;code&gt;pressed = false&lt;/code&gt;. Neither call touches the operating system: Godot's docs say sending Alt/Cmd + Tab as an &lt;code&gt;InputEventKey&lt;/code&gt; "won't toggle between active windows".&lt;/p&gt;

&lt;h2&gt;
  
  
  Pitfalls
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Headless runs don't click Controls.&lt;/strong&gt; With &lt;code&gt;godot --headless&lt;/code&gt;, Godot 4.7.2 delivered our simulated clicks to &lt;code&gt;_input&lt;/code&gt; but never pressed a &lt;code&gt;Button&lt;/code&gt;: the click test failed in GUT 9.7.1, in GdUnit4 6.2.3 and in a plain project using &lt;code&gt;Input.parse_input_event&lt;/code&gt;, and passed in all three under &lt;code&gt;xvfb-run&lt;/code&gt; (GUT with &lt;code&gt;-gcompact_mode&lt;/code&gt;). GdUnit4 6.2.3's own warning says "Godot 'InputEvents' are not transported by the Godot engine in headless mode", although our key and action tests passed headless. GdUnit4's unreleased master runs the scene in its own &lt;code&gt;SubViewport&lt;/code&gt;, and there the click test passed headless.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;GUT's results panel covers the game.&lt;/strong&gt; Under &lt;code&gt;xvfb-run&lt;/code&gt;, GUT 9.7.1's click test still failed, because GUT's output panel, on a &lt;code&gt;CanvasLayer&lt;/code&gt; at layer 128, was the control under the click. With &lt;code&gt;-gcompact_mode&lt;/code&gt; the click reached the button and the test passed.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;GdUnit4 6.2.3 refuses &lt;code&gt;--headless&lt;/code&gt;.&lt;/strong&gt; GdUnit4 6.2.3's &lt;code&gt;runtest.sh --headless&lt;/code&gt; stops with "Headless mode is not supported!" and exit code 103 before running any test, unless you add &lt;code&gt;--ignoreHeadlessMode&lt;/code&gt;. GdUnit4's master says headless "is supported by default".&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;simulate_frames&lt;/code&gt; counts frames, not seconds.&lt;/strong&gt; GdUnit4's &lt;code&gt;simulate_frames(72)&lt;/code&gt; waits for 72 process frames, so the game time that passes depends on the frame rate. Holding &lt;code&gt;ui_right&lt;/code&gt; for 72 frames passed headless, where the test took about half a second, and failed 3 times out of 3 under &lt;code&gt;xvfb-run&lt;/code&gt;, where it took 110 to 178 ms and the player never reached the star. Wait for time instead: &lt;code&gt;await await_millis(1200)&lt;/code&gt; in GdUnit4, &lt;code&gt;hold_for(1.2)&lt;/code&gt; in GUT.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;simulate_action_pressed&lt;/code&gt; is too short for polling.&lt;/strong&gt; GdUnit4 6.2.3's &lt;code&gt;simulate_action_pressed&lt;/code&gt; presses and releases the action in the same call: right after it, &lt;code&gt;Input.is_action_pressed("ui_right")&lt;/code&gt; was false, and the Star Catcher player, which reads &lt;code&gt;Input.get_vector&lt;/code&gt; in &lt;code&gt;_physics_process&lt;/code&gt;, moved 0 px in the next 500 ms. Use &lt;code&gt;simulate_action_press&lt;/code&gt;, wait, then &lt;code&gt;simulate_action_release&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;GdUnit4's Shift and Ctrl arguments are going away.&lt;/strong&gt; GdUnit4 6.2.3 prints "Deprecated! Don't use 'shift_pressed' it will be removed in v7.0" for &lt;code&gt;simulate_key_pressed(KEY_A, true)&lt;/code&gt;, and on GdUnit4's master the same call is a parse error, "Too many arguments for "simulate_key_pressed()" call". Hold &lt;code&gt;KEY_SHIFT&lt;/code&gt; with &lt;code&gt;simulate_key_press&lt;/code&gt; instead.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Running headless in CI
&lt;/h2&gt;

&lt;p&gt;Import the project once, then run the suite. For tests that only use keys and actions, headless is enough:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;godot &lt;span class="nt"&gt;--headless&lt;/span&gt; &lt;span class="nt"&gt;--path&lt;/span&gt; &lt;span class="nb"&gt;.&lt;/span&gt; &lt;span class="nt"&gt;--import&lt;/span&gt;
godot &lt;span class="nt"&gt;--headless&lt;/span&gt; &lt;span class="nt"&gt;--path&lt;/span&gt; &lt;span class="nb"&gt;.&lt;/span&gt; &lt;span class="nt"&gt;-s&lt;/span&gt; addons/gut/gut_cmdln.gd &lt;span class="nt"&gt;-gdir&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;res://test &lt;span class="nt"&gt;-gexit&lt;/span&gt;
./addons/gdUnit4/runtest.sh &lt;span class="nt"&gt;--godot_binary&lt;/span&gt; /usr/bin/godot &lt;span class="nt"&gt;--headless&lt;/span&gt; &lt;span class="nt"&gt;--ignoreHeadlessMode&lt;/span&gt; &lt;span class="nt"&gt;-a&lt;/span&gt; res://test
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;GUT 9.7.1 exited 0 when every test passed and 1 when one failed. GdUnit4 6.2.3's &lt;code&gt;runtest.sh&lt;/code&gt; exited 0 on success, 100 when a test failed, and 103 when we left out &lt;code&gt;--ignoreHeadlessMode&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;For tests that click Controls, drop &lt;code&gt;--headless&lt;/code&gt; and run under &lt;code&gt;xvfb-run&lt;/code&gt;, which starts a virtual X display, so the CI machine needs no screen:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;xvfb-run &lt;span class="nt"&gt;-a&lt;/span&gt; godot &lt;span class="nt"&gt;--path&lt;/span&gt; &lt;span class="nb"&gt;.&lt;/span&gt; &lt;span class="nt"&gt;-s&lt;/span&gt; addons/gut/gut_cmdln.gd &lt;span class="nt"&gt;-gdir&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;res://test &lt;span class="nt"&gt;-gcompact_mode&lt;/span&gt; &lt;span class="nt"&gt;-gexit&lt;/span&gt;
xvfb-run &lt;span class="nt"&gt;-a&lt;/span&gt; ./addons/gdUnit4/runtest.sh &lt;span class="nt"&gt;--godot_binary&lt;/span&gt; /usr/bin/godot &lt;span class="nt"&gt;-a&lt;/span&gt; res://test
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Both exited 0 with all three tests passing.&lt;/p&gt;

&lt;p&gt;If you would rather not script inputs in a test framework, &lt;a href="https://ziva.sh/docs/creating#playtest-your-game" rel="noopener noreferrer"&gt;Ziva&lt;/a&gt;, an AI agent inside the Godot editor, has a &lt;code&gt;run_scene&lt;/code&gt; tool that runs a scene in the open editor with timed key, action and mouse inputs and returns the runtime errors, the console output and a screenshot; Ziva's &lt;code&gt;run_scene&lt;/code&gt; doesn't replace GUT or GdUnit4 tests and doesn't run headless in CI.&lt;/p&gt;

&lt;h2&gt;
  
  
  Related reading
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://ziva.sh/blogs/godot-automated-playtesting" rel="noopener noreferrer"&gt;How to automate playtesting in Godot&lt;/a&gt;: bots, MCP servers and AI agents&lt;/li&gt;
&lt;li&gt;&lt;a href="https://gut.readthedocs.io/en/latest/Mocking-Input.html" rel="noopener noreferrer"&gt;GUT: Mocking Input&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;GdUnit4 scene runner: &lt;a href="https://godot-gdunit-labs.github.io/gdUnit4/latest/advanced_testing/scene_runner/actions/" rel="noopener noreferrer"&gt;actions&lt;/a&gt;, &lt;a href="https://godot-gdunit-labs.github.io/gdUnit4/latest/advanced_testing/scene_runner/keys/" rel="noopener noreferrer"&gt;keys&lt;/a&gt;, &lt;a href="https://godot-gdunit-labs.github.io/gdUnit4/latest/advanced_testing/scene_runner/mouse/" rel="noopener noreferrer"&gt;mouse&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  FAQ
&lt;/h2&gt;

&lt;h3&gt;
  
  
  How do I simulate keyboard and mouse input in Godot tests (GUT or GdUnit4)?
&lt;/h3&gt;

&lt;p&gt;In GUT, create GutInputSender.new(Input), queue input such as key_down(KEY_RIGHT).hold_for(1.2).wait(0.3), action_down("ui_right") or mouse_left_click_at(Vector2(350, 220)), await the sender's idle signal, then assert; call release_all() and clear() in after_each. In GdUnit4, load the scene with scene_runner("res://main.tscn") and call simulate_key_press and simulate_key_release, simulate_action_press and simulate_action_release, or set_mouse_position and simulate_mouse_button_pressed, wait with await await_millis(1200) rather than a frame count, then await runner.await_input_processed() before asserting. In our Godot 4.7.2 tests with GUT 9.7.1 and GdUnit4 6.2.3, key and action input worked headless, but clicks on a Button only worked with a display, such as xvfb-run.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why doesn't my simulated mouse click press a Button when I run Godot tests headless?
&lt;/h3&gt;

&lt;p&gt;With godot --headless, Godot 4.7.2 delivered our simulated mouse clicks to _input but never pressed a Button, in GUT 9.7.1, in GdUnit4 6.2.3 and in a plain project using Input.parse_input_event. The same tests passed under xvfb-run, a virtual X display. GdUnit4 6.2.3's own warning says "Godot 'InputEvents' are not transported by the Godot engine in headless mode". In GUT, also pass -gcompact_mode on a display, because GUT's results panel otherwise covers the game and takes the click.&lt;/p&gt;

&lt;h3&gt;
  
  
  How do I run GUT or GdUnit4 tests headless in CI, and what exit codes do they return?
&lt;/h3&gt;

&lt;p&gt;Import once with godot --headless --path . --import. GUT 9.7.1: godot --headless --path . -s addons/gut/gut_cmdln.gd -gdir=res://test -gexit, which exited 0 when every test passed and 1 when one failed. GdUnit4 6.2.3: ./addons/gdUnit4/runtest.sh --godot_binary /usr/bin/godot --headless --ignoreHeadlessMode -a res://test, which exits 0 on success and 100 on a failed test; without --ignoreHeadlessMode, GdUnit4 6.2.3 refuses to run headless and exits 103. For tests that click Controls, run either tool without --headless under xvfb-run -a.&lt;/p&gt;

&lt;h3&gt;
  
  
  What is the difference between Input.parse_input_event and Input.action_press in Godot?
&lt;/h3&gt;

&lt;p&gt;Input.parse_input_event feeds an InputEvent, such as an InputEventKey, through Godot's input system, so Node._input() receives it and any action mapped to that key becomes pressed. Input.action_press only marks the action as pressed: Input.is_action_pressed returns true, but Godot's docs say it "will not cause any Node._input() calls". In our Godot 4.7.2 run, a node's _input printed the parsed key press and release and nothing for action_press.&lt;/p&gt;

</description>
      <category>godot</category>
      <category>testing</category>
      <category>gamedev</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Godot MCP server for Claude Code and Cursor: run the game, send input, take screenshots</title>
      <dc:creator>Ziva</dc:creator>
      <pubDate>Sat, 07 Nov 2026 06:42:41 +0000</pubDate>
      <link>https://dev.to/ziva/godot-mcp-server-for-claude-code-and-cursor-run-the-game-send-input-take-screenshots-5cm</link>
      <guid>https://dev.to/ziva/godot-mcp-server-for-claude-code-and-cursor-run-the-game-send-input-take-screenshots-5cm</guid>
      <description>&lt;p&gt;Several Godot MCP servers let Claude Code or Cursor run your game, send it input and screenshot the running game: Ziva, Godot MCP Pro, GDAI MCP, Godot AI (hi-godot/godot-ai) and Erodenn/godot-mcp-runtime, plus Summer Engine's MCP for Summer's own editor. In &lt;a href="https://ziva.sh/docs/ziva-mcp-server" rel="noopener noreferrer"&gt;Ziva&lt;/a&gt;, one tool does all three: &lt;code&gt;run_scene&lt;/code&gt; runs a scene in the open Godot editor, sends timed keyboard, mouse, input-action and UI-click input, and returns a screenshot of the running game with that run's console output and runtime errors. Ziva's &lt;code&gt;get_godot_errors&lt;/code&gt; reads Godot's errors and output, and Ziva's &lt;code&gt;get_screenshot&lt;/code&gt; captures the editor, not the game. To connect Claude Code, click &lt;strong&gt;Install for Claude Code&lt;/strong&gt; in Ziva's settings, which runs &lt;code&gt;claude mcp add --scope user ziva-godot -- ...&lt;/code&gt; for you. The Ziva plugin supports Godot 4.2 or later and its MCP tools need no paid plan, but Ziva's &lt;code&gt;run_scene&lt;/code&gt; and &lt;code&gt;get_screenshot&lt;/code&gt; need the Ziva dock signed in (the free Hobby plan works). In &lt;a href="https://ziva.sh/blogs/godot-mcp-server-claude-code-cursor#tested-claude-code-running-and-fixing-a-godot-game-through-zivas-mcp-server" rel="noopener noreferrer"&gt;our 11 November 2026 test&lt;/a&gt;, Claude Code used Ziva's &lt;code&gt;run_scene&lt;/code&gt; and &lt;code&gt;edit_file&lt;/code&gt; to find and fix a bug in a sample game, then confirmed the fix from the screenshot.&lt;/p&gt;

&lt;p&gt;Ziva.sh makes Ziva, which is proprietary, publishes this page and ran the tests on it. Facts about other servers are quoted from each vendor's own page or README as of 7 November 2026, except Godot AI's C# statement, from its README on 4 November 2026. Disclosure: GDAI MCP is made by Delano Lourenco, a Ziva cofounder.&lt;/p&gt;

&lt;h2&gt;
  
  
  Godot MCP servers compared: run, input, screenshot
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Server&lt;/th&gt;
&lt;th&gt;Cost/licence&lt;/th&gt;
&lt;th&gt;Setup&lt;/th&gt;
&lt;th&gt;Run game&lt;/th&gt;
&lt;th&gt;Input to running game&lt;/th&gt;
&lt;th&gt;Game screenshot&lt;/th&gt;
&lt;th&gt;Errors/output&lt;/th&gt;
&lt;th&gt;Godot version&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;a href="https://ziva.sh/docs/ziva-mcp-server" rel="noopener noreferrer"&gt;Ziva&lt;/a&gt; (local MCP server inside the Ziva plugin)&lt;/td&gt;
&lt;td&gt;Ziva: free Hobby plan works; sign-in needed for screenshots&lt;/td&gt;
&lt;td&gt;Ziva: install the plugin, click &lt;strong&gt;Install for Claude Code&lt;/strong&gt; or &lt;strong&gt;Install for Cursor&lt;/strong&gt;; no Node.js or uv&lt;/td&gt;
&lt;td&gt;Ziva: &lt;code&gt;run_scene&lt;/code&gt;, in the open editor&lt;/td&gt;
&lt;td&gt;Ziva: &lt;code&gt;run_scene&lt;/code&gt; actions, keys, left and right clicks, clicks on a Control by path or text, mouse motion&lt;/td&gt;
&lt;td&gt;Ziva: &lt;code&gt;run_scene&lt;/code&gt; returns the final frame; &lt;code&gt;get_screenshot&lt;/code&gt; is the editor only&lt;/td&gt;
&lt;td&gt;Ziva: &lt;code&gt;run_scene&lt;/code&gt; output and runtime errors; &lt;code&gt;get_godot_errors&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;Ziva: plugin 4.2+; we ran &lt;code&gt;run_scene&lt;/code&gt; on 4.7.2&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="https://github.com/Coding-Solo/godot-mcp" rel="noopener noreferrer"&gt;Coding-Solo/godot-mcp&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;Coding-Solo/godot-mcp: free, MIT&lt;/td&gt;
&lt;td&gt;Coding-Solo/godot-mcp: &lt;code&gt;claude mcp add godot -- npx @coding-solo/godot-mcp&lt;/code&gt;; Node.js 18+&lt;/td&gt;
&lt;td&gt;Coding-Solo/godot-mcp: "Execute Godot projects in debug mode"&lt;/td&gt;
&lt;td&gt;Coding-Solo/godot-mcp: not stated&lt;/td&gt;
&lt;td&gt;Coding-Solo/godot-mcp: not stated&lt;/td&gt;
&lt;td&gt;Coding-Solo/godot-mcp: "Retrieve console output and error messages"&lt;/td&gt;
&lt;td&gt;Coding-Solo/godot-mcp: not stated; UID tools need 4.4+&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="https://gdaimcp.com/" rel="noopener noreferrer"&gt;GDAI MCP&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;GDAI MCP: "$19 one-time payment", &lt;a href="https://gdaimcp.com/license" rel="noopener noreferrer"&gt;binary only&lt;/a&gt;
&lt;/td&gt;
&lt;td&gt;GDAI MCP: addon in &lt;code&gt;res://addons/&lt;/code&gt;, plus &lt;code&gt;uv&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;GDAI MCP: &lt;code&gt;play_scene&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;GDAI MCP: &lt;code&gt;simulate_input&lt;/code&gt;, "keyboard keys and input actions"; mouse not stated&lt;/td&gt;
&lt;td&gt;GDAI MCP: &lt;code&gt;get_running_scene_screenshot&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;GDAI MCP: &lt;code&gt;get_godot_errors&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;GDAI MCP: "Godot 4.2+" on its site; its GitHub README says 4.1+&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="https://godot-mcp.abyo.net/" rel="noopener noreferrer"&gt;Godot MCP Pro&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;Godot MCP Pro: "$15 one-time purchase"; server proprietary&lt;/td&gt;
&lt;td&gt;Godot MCP Pro: addon plus the Node.js server from the paid package; Node.js 18+&lt;/td&gt;
&lt;td&gt;Godot MCP Pro: &lt;code&gt;play_scene&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;Godot MCP Pro: &lt;code&gt;simulate_key&lt;/code&gt;, &lt;code&gt;simulate_mouse_click&lt;/code&gt;, &lt;code&gt;simulate_mouse_move&lt;/code&gt;, &lt;code&gt;simulate_action&lt;/code&gt;, &lt;code&gt;simulate_sequence&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;Godot MCP Pro: &lt;code&gt;get_game_screenshot&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;Godot MCP Pro: &lt;code&gt;get_editor_errors&lt;/code&gt;, &lt;code&gt;get_output_log&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;Godot MCP Pro: "Godot 4.4 or later"&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="https://github.com/hi-godot/godot-ai" rel="noopener noreferrer"&gt;Godot AI (hi-godot/godot-ai)&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;Godot AI: free, MIT&lt;/td&gt;
&lt;td&gt;Godot AI: addon from AssetLib, &lt;code&gt;uv&lt;/code&gt;, then &lt;strong&gt;Configure&lt;/strong&gt; in the Godot AI dock&lt;/td&gt;
&lt;td&gt;Godot AI: &lt;code&gt;project_run&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;Godot AI: &lt;code&gt;game_manage&lt;/code&gt; with &lt;code&gt;input_key&lt;/code&gt;, &lt;code&gt;input_mouse&lt;/code&gt;, &lt;code&gt;input_gamepad&lt;/code&gt;, &lt;code&gt;input_action&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;Godot AI: &lt;code&gt;editor_screenshot&lt;/code&gt; of the "running game framebuffer"&lt;/td&gt;
&lt;td&gt;Godot AI: &lt;code&gt;logs_read&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;Godot AI: "Godot 4.7+"&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="https://github.com/Erodenn/godot-mcp-runtime" rel="noopener noreferrer"&gt;Erodenn/godot-mcp-runtime&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;godot-mcp-runtime: free, MIT&lt;/td&gt;
&lt;td&gt;godot-mcp-runtime: &lt;code&gt;npx -y godot-mcp-runtime&lt;/code&gt; with &lt;code&gt;GODOT_PATH&lt;/code&gt;; Node.js 20+; "No Godot addon"&lt;/td&gt;
&lt;td&gt;godot-mcp-runtime: &lt;code&gt;run_project&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;godot-mcp-runtime: &lt;code&gt;simulate_input&lt;/code&gt;: keys, mouse clicks and motion, clicks on UI elements, actions, text&lt;/td&gt;
&lt;td&gt;godot-mcp-runtime: &lt;code&gt;take_screenshot&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;godot-mcp-runtime: &lt;code&gt;get_debug_output&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;godot-mcp-runtime: "Godot 4.x"&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="https://www.summerengine.com/godot-mcp" rel="noopener noreferrer"&gt;Summer Engine MCP&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;Summer Engine: "free, MIT-licensed"; "Cloud generation ... uses credits"&lt;/td&gt;
&lt;td&gt;Summer Engine: &lt;code&gt;npx -y summer-engine@latest setup claude-code --yes&lt;/code&gt;, plus the Summer Engine desktop app&lt;/td&gt;
&lt;td&gt;Summer Engine: &lt;code&gt;summer_play&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;Summer Engine: &lt;code&gt;summer_game_input&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;Summer Engine: &lt;code&gt;summer_screenshot&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;Summer Engine: &lt;code&gt;summer_get_debugger_errors&lt;/code&gt;, &lt;code&gt;summer_get_console&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;Summer Engine: its own desktop app, "compatible with Godot 4"; not stock Godot&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Notes on the table:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Erodenn/godot-mcp-runtime's README calls it "a lightweight &lt;a href="https://modelcontextprotocol.io/" rel="noopener noreferrer"&gt;MCP&lt;/a&gt; server" whose "runtime bridge adds screenshots, input simulation, UI discovery, and live GDScript against the running scene tree". Erodenn/godot-mcp-runtime injects that bridge as an autoload when &lt;code&gt;run_project&lt;/code&gt; is called and says it leaves "No leftover autoloads, no modified project files".&lt;/li&gt;
&lt;li&gt;Summer Engine's FAQ answers "Does Summer MCP work with the stock Godot editor?" with "No. Its engine tools drive the Summer Engine desktop app, which is compatible with Godot 4 and opens compatible Godot 4 projects."&lt;/li&gt;
&lt;li&gt;Godot MCP Pro's site lists "187 Tools, 26 Categories". Godot AI's README lists "46 tools and 120+ operations".&lt;/li&gt;
&lt;li&gt;Coding-Solo/godot-mcp had 6,547 GitHub stars on 7 November 2026. Coding-Solo/godot-mcp's README lists running the project, capturing debug output and editing scenes, and lists no input or screenshot tool.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Set up Ziva's MCP server in Claude Code or Cursor
&lt;/h2&gt;

&lt;p&gt;Ziva's MCP server ships inside the Ziva plugin and runs only on your computer, with no hosted URL. &lt;a href="https://ziva.sh/docs/installation" rel="noopener noreferrer"&gt;Install Ziva&lt;/a&gt; in your Godot project, open the project in Godot, wait for Ziva to start and sign in to Ziva in its dock. In Ziva, open &lt;strong&gt;Settings → Models &amp;amp; Providers → Ziva as an MCP server&lt;/strong&gt; and check that it shows &lt;strong&gt;Running&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Claude Code
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Make sure the &lt;code&gt;claude&lt;/code&gt; command works in your terminal.&lt;/li&gt;
&lt;li&gt;Under &lt;strong&gt;AI application&lt;/strong&gt;, choose &lt;strong&gt;Claude Code&lt;/strong&gt; and click &lt;strong&gt;Install for Claude Code&lt;/strong&gt;. Ziva runs &lt;code&gt;claude mcp add --scope user ziva-godot -- ...&lt;/code&gt; with its generated command, so &lt;code&gt;ziva-godot&lt;/code&gt; is available in every project.&lt;/li&gt;
&lt;li&gt;Start a new Claude Code session from your Godot project folder and ask: "Use ziva-godot's run_scene tool to run res://main.tscn for 2500 ms, holding ui_right from 300 ms for 1200 ms, and tell me which errors it printed."&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Cursor
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Under &lt;strong&gt;AI application&lt;/strong&gt;, choose &lt;strong&gt;Cursor&lt;/strong&gt; and click &lt;strong&gt;Install for Cursor&lt;/strong&gt;. Ziva adds &lt;code&gt;ziva-godot&lt;/code&gt; under &lt;code&gt;mcpServers&lt;/code&gt; in your project's &lt;code&gt;.cursor/mcp.json&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Open that same project folder in Cursor and restart Cursor.&lt;/li&gt;
&lt;li&gt;Ask Cursor to use ziva-godot's &lt;code&gt;run_scene&lt;/code&gt; on a scene, as in the Claude Code example.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If Godot is closed, a command-line client such as Claude Code started from your project folder sees one Ziva tool, &lt;code&gt;start_godot&lt;/code&gt;, which opens the editor; after that, the full Ziva tool list appears. Codex, VS Code, Windsurf, Zed, Gemini CLI and other apps have their own &lt;strong&gt;Install for [app]&lt;/strong&gt; button, and the &lt;a href="https://ziva.sh/docs/ziva-mcp-server" rel="noopener noreferrer"&gt;Ziva MCP server guide&lt;/a&gt; has the manual setup.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Ziva's MCP tools return
&lt;/h2&gt;

&lt;p&gt;Ziva's &lt;code&gt;run_scene&lt;/code&gt; takes a scene path, a run length in &lt;code&gt;duration_ms&lt;/code&gt; and an optional list of timed inputs. Each input starts at &lt;code&gt;at_ms&lt;/code&gt; and is held for &lt;code&gt;hold_ms&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;"scene_path"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"res://main.tscn"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"duration_ms"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;2500&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"inputs"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"action"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nl"&gt;"action"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"ui_right"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nl"&gt;"at_ms"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;300&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nl"&gt;"hold_ms"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1200&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"key"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nl"&gt;"key"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"Space"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nl"&gt;"at_ms"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1600&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nl"&gt;"hold_ms"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Ziva's input types are &lt;code&gt;action&lt;/code&gt; (a named input action), &lt;code&gt;key&lt;/code&gt; (a raw keyboard key, with Shift, Ctrl, Alt or Meta held as modifiers), &lt;code&gt;mouse&lt;/code&gt; (a left or right click at a pixel position), &lt;code&gt;target&lt;/code&gt; (a click on a Control found by node path or visible text) and &lt;code&gt;motion&lt;/code&gt; (relative mouse movement, for a camera with a captured mouse). Ziva's &lt;code&gt;run_scene&lt;/code&gt; returns:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;One screenshot: the final frame of the running game, as an image Claude Code or Cursor can look at.&lt;/li&gt;
&lt;li&gt;An input delivery report with the frame and millisecond each press and release landed on, so the client can tell an input the game never got from one it ignored.&lt;/li&gt;
&lt;li&gt;The Godot console output and runtime errors from that run, with file and line.&lt;/li&gt;
&lt;li&gt;With &lt;code&gt;speed: true&lt;/code&gt;, the frame rate, and when the run is slow, the slowest functions with file and line.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Ziva's other tools for this loop are &lt;code&gt;get_godot_errors&lt;/code&gt; for script errors, runtime errors, stack traces and &lt;code&gt;print()&lt;/code&gt; output, &lt;code&gt;get_screenshot&lt;/code&gt; for the editor window or its 2D or 3D viewport, &lt;code&gt;get_scene_tree&lt;/code&gt; to inspect the scene, and &lt;code&gt;run_tests&lt;/code&gt; for a test suite. MCP calls skip Ziva's approval prompts, so use your client's permission settings. In our &lt;a href="https://ziva.sh/blogs/godot-automated-playtesting#what-zivas-run_scene-returned-on-star-catcher" rel="noopener noreferrer"&gt;Godot playtesting guide&lt;/a&gt;, Ziva's &lt;code&gt;run_scene&lt;/code&gt; held &lt;code&gt;ui_right&lt;/code&gt; in a sample game and returned the null-instance error from &lt;code&gt;res://main.gd:15&lt;/code&gt; with a screenshot showing the score still at 0.&lt;/p&gt;

&lt;h2&gt;
  
  
  Tested: Claude Code running and fixing a Godot game through Ziva's MCP server
&lt;/h2&gt;

&lt;p&gt;On 7 November 2026 we connected Claude Code 2.1.318 to Ziva's MCP server with the same stdio command Ziva's &lt;strong&gt;Install for Claude Code&lt;/strong&gt; button registers, opened the &lt;a href="https://github.com/ziva-sh/ziva-godot-sample" rel="noopener noreferrer"&gt;Star Catcher sample&lt;/a&gt; in Godot 4.7.2 with a development build of Ziva from 7 November 2026 and the Ziva dock signed in to a Hobby account, and ran one prompt:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Use the ziva-godot MCP tools. Run the main scene of this Godot project for about 4 seconds while holding the right arrow key (ui_right) for 2 seconds, then tell me what the screenshot shows and list any runtime errors exactly as reported. Do not edit any files.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Claude Code saw 42 &lt;code&gt;ziva-godot&lt;/code&gt; tools, read the main scene path with Ziva's &lt;code&gt;get_project_info&lt;/code&gt;, then called Ziva's &lt;code&gt;run_scene&lt;/code&gt; once:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;"scene_path"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"res://main.tscn"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"duration_ms"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;4000&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"inputs"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"action"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nl"&gt;"action"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"ui_right"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nl"&gt;"at_ms"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nl"&gt;"hold_ms"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;2000&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The call took 8.1 seconds. Ziva's input delivery report said the press landed at 0 ms and the release at 2009 ms, and Ziva's &lt;code&gt;run_scene&lt;/code&gt; returned the sample's two real errors word for word:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ERROR: main.gd:5 @ @implicit_ready(): Node not found: "%ScoreLabel" (relative to "/root/Main").
ERROR: _on_star_collected: Invalid assignment of property or key 'text' with value of type 'String' on a base object of type 'null instance'.
  Source: res://main.gd:15
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fpkj9j7inffrq4ckop167.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fpkj9j7inffrq4ckop167.png" alt="Final frame returned by Ziva's run_scene to Claude Code after holding ui_right for 2 seconds in the Star Catcher sample: one star has been collected, two yellow stars remain, and the label still reads Score: 0 because the score label reference is null" width="640" height="360"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;From the screenshot and the errors, Claude Code concluded that a star was collected but the score label never updated, which is the bug.&lt;/p&gt;

&lt;h3&gt;
  
  
  Rerun on 11 November 2026: finding and fixing the bug
&lt;/h3&gt;

&lt;p&gt;On 11 November 2026 we reran the tests with Claude Code 2.1.318 loading only the &lt;code&gt;ziva-godot&lt;/code&gt; MCP server and no user-level Claude Code settings, plugins, memory or instruction files, on a development build of Ziva from that day. The prompt above returned the same frame and the same errors. Then we asked Claude Code to fix the game:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;This Godot game's score never goes up when I collect a star. Use the ziva-godot MCP tools to run the game, find the bug, fix it, then run the game again holding the right arrow key to confirm the score changes.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Claude Code ran the game with Ziva's &lt;code&gt;run_scene&lt;/code&gt; holding the right arrow key, read the scripts and scenes with Ziva's &lt;code&gt;read&lt;/code&gt;, and changed one line of &lt;code&gt;main.gd&lt;/code&gt; with Ziva's &lt;code&gt;edit_file&lt;/code&gt;, which answered "No problems in this file or its callers":&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight diff"&gt;&lt;code&gt;&lt;span class="gd"&gt;-@onready var score_label: Label = %ScoreLabel&lt;/span&gt;
&lt;span class="gi"&gt;+@onready var score_label: Label = $HUD/%ScoreLabel&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It ran the game again holding the key for 0.6 seconds instead of 2.5, because the longer hold carried the player off screen. The final frame showed "Score: 1", and neither script error came back. The run took 37.6 seconds and 12 turns, and Claude Code's own Read and Edit tools, though allowed, were not used.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fnqqdglmgurh97id1295v.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fnqqdglmgurh97id1295v.webp" alt="Final frame returned by Ziva's run_scene to Claude Code after its one-line fix to main.gd in the Star Catcher sample: the teal player square has stopped next to where the first star was and the label reads Score: 1" width="640" height="360"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The same rerun also checked:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Godot closed:&lt;/strong&gt; Claude Code saw only Ziva's &lt;code&gt;start_godot&lt;/code&gt;, called it, and had the editor running 4.1 seconds later with the full Ziva tool list in the same turn. Its first &lt;code&gt;run_scene&lt;/code&gt; worked. On 7 November, &lt;code&gt;start_godot&lt;/code&gt; took 5.2 seconds and the first &lt;code&gt;run_scene&lt;/code&gt; after it hit a one-off upload error, then worked on retry.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Ziva dock signed out:&lt;/strong&gt; Ziva's &lt;code&gt;run_scene&lt;/code&gt; still ran the game but returned only "The Run Scene tool failed: Not signed in (no API key on init payload)". Claude Code then told us "The tool failed before the game started", which is wrong: the game ran and logged both errors. This is an open Ziva bug. On 7 November, Ziva's &lt;code&gt;get_godot_errors&lt;/code&gt; and &lt;code&gt;get_project_info&lt;/code&gt; still worked signed out, and &lt;code&gt;get_godot_errors&lt;/code&gt; returned that run's errors.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cursor:&lt;/strong&gt; we did not run Cursor or its agent. On 10 November we clicked &lt;strong&gt;Install for Cursor&lt;/strong&gt;, which wrote &lt;code&gt;ziva-godot&lt;/code&gt; to the project's &lt;code&gt;.cursor/mcp.json&lt;/code&gt;, then launched that file's exact command with our own MCP client: it listed 42 tools, and Ziva's &lt;code&gt;run_scene&lt;/code&gt; returned the screenshot, the input delivery report and both errors.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Each Claude Code test ran once on each date, on Linux, with Claude Code in headless mode (&lt;code&gt;claude -p&lt;/code&gt;) and Godot on a virtual display.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Ziva's MCP server can't do
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Ziva's &lt;code&gt;run_scene&lt;/code&gt; returns one frame per call, not a video or a stream. To see a later moment, call it again with a longer &lt;code&gt;duration_ms&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Ziva's &lt;code&gt;run_scene&lt;/code&gt; needs the Godot editor open, so Ziva has no headless or CI mode.&lt;/li&gt;
&lt;li&gt;Ziva's &lt;code&gt;run_scene&lt;/code&gt; has no gamepad or touch input.&lt;/li&gt;
&lt;li&gt;Ziva's &lt;code&gt;run_scene&lt;/code&gt; refuses to start while you are playing a game in the editor, because it would close your game.&lt;/li&gt;
&lt;li&gt;Ziva's Full Game Playtest Agent, which plays toward a goal and returns pass, fail or blocked, is not available over MCP.&lt;/li&gt;
&lt;li&gt;Ziva's &lt;code&gt;run_scene&lt;/code&gt; and &lt;code&gt;get_screenshot&lt;/code&gt; need the Ziva dock signed in, because Ziva uploads each screenshot to Ziva's servers before returning it. Signed out, they return "Not signed in", and &lt;code&gt;run_scene&lt;/code&gt; still runs the game first.&lt;/li&gt;
&lt;li&gt;Ziva's &lt;code&gt;run_scene&lt;/code&gt; only appears when &lt;strong&gt;Enable playtest tool&lt;/strong&gt; is on in Ziva's &lt;strong&gt;Settings → Agent&lt;/strong&gt;. Ziva's &lt;code&gt;generate_image&lt;/code&gt; tool draws on your plan's included usage.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  How to choose a Godot MCP server
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Pick Ziva&lt;/strong&gt; if you also want an AI agent inside the Godot editor, or you don't want to install Node.js or uv. Ziva's &lt;code&gt;run_scene&lt;/code&gt; gives Claude Code or Cursor input, a screenshot and errors in one call.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Pick Godot AI (hi-godot/godot-ai)&lt;/strong&gt; if you are on Godot 4.7 or later and want a free, MIT-licensed server with gamepad input.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Pick Erodenn/godot-mcp-runtime&lt;/strong&gt; if you want a free, MIT server with no addon to install or commit, or the game launched without the editor open.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Pick Coding-Solo/godot-mcp&lt;/strong&gt; if you only need to run the project and read errors, with no editor addon.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Pick Godot MCP Pro or GDAI MCP&lt;/strong&gt; if you prefer a one-time purchase: Godot MCP Pro lists mouse input and needs Godot 4.4 or later, and GDAI MCP lists keys and input actions.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;For CI&lt;/strong&gt;, use scripted GUT or GdUnit4 input tests rather than an MCP client; our &lt;a href="https://ziva.sh/blogs/godot-automated-playtesting" rel="noopener noreferrer"&gt;playtesting guide&lt;/a&gt; has tested examples.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Related reading
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://ziva.sh/docs/ziva-mcp-server" rel="noopener noreferrer"&gt;Ziva as an MCP server&lt;/a&gt;: full setup for every supported app&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://ziva.sh/blogs/godot-automated-playtesting" rel="noopener noreferrer"&gt;How to automate playtesting in Godot&lt;/a&gt;: GUT, GdUnit4, headless bots and AI agents&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://ziva.sh/blogs/ziva-vs-godot-mcp" rel="noopener noreferrer"&gt;Ziva vs Godot MCP&lt;/a&gt;: Ziva compared with Coding-Solo and other open-source servers&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://ziva.sh/blogs/ziva-vs-gdai-mcp" rel="noopener noreferrer"&gt;Ziva vs GDAI MCP&lt;/a&gt;: Ziva compared with GDAI MCP&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  FAQ
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Which Godot MCP server lets Claude Code run the game, send input and take screenshots?
&lt;/h3&gt;

&lt;p&gt;As of 7 November 2026, these Godot MCP servers list all three: Ziva's local MCP server, whose run_scene tool runs a scene in the open Godot editor, sends timed keyboard, mouse, input-action and UI-click input, and returns a screenshot of the running game with its console output and runtime errors; Godot MCP Pro ($15 one-time) with play_scene, simulate_key, simulate_mouse_click and get_game_screenshot; GDAI MCP ($19 one-time) with play_scene, simulate_input for keys and input actions, and get_running_scene_screenshot; Godot AI (hi-godot/godot-ai, free, MIT, Godot 4.7+) with project_run, game_manage input operations and editor_screenshot of the running game; and Erodenn/godot-mcp-runtime (free, MIT, no addon) with run_project, simulate_input and take_screenshot. Summer Engine's MCP does the same in Summer's own desktop editor, not the stock Godot editor. Coding-Solo/godot-mcp runs the project and captures debug output, and its README lists no input or screenshot tool.&lt;/p&gt;

&lt;h3&gt;
  
  
  How do I connect Claude Code or Cursor to Ziva's Godot MCP server?
&lt;/h3&gt;

&lt;p&gt;Open your Godot project with the Ziva plugin installed, then in Ziva open Settings → Models &amp;amp; Providers → Ziva as an MCP server and check that it shows Running. Under AI application, choose Claude Code and click Install for Claude Code, which runs claude mcp add --scope user ziva-godot with Ziva's generated command; or choose Cursor and click Install for Cursor, which adds ziva-godot to the project's .cursor/mcp.json. Ziva's MCP server is bundled in the Ziva plugin, so there is no Node.js or uv to install, and it runs on your computer, not at a hosted URL. Ziva's run_scene and get_screenshot need the Ziva dock signed in; the free Hobby plan works.&lt;/p&gt;

&lt;h3&gt;
  
  
  Does Ziva's get_screenshot tool show the running game?
&lt;/h3&gt;

&lt;p&gt;No. Ziva's get_screenshot captures the Godot editor: the whole window, the 2D or 3D viewport, or the Ziva panel. A screenshot of the running game comes from Ziva's run_scene, which returns the final frame of each run, so to see a later moment call run_scene again with a longer duration_ms.&lt;/p&gt;

&lt;h3&gt;
  
  
  Is there an MCP server that works with Godot C# (.NET) projects?
&lt;/h3&gt;

&lt;p&gt;Yes, with limits. Ziva's local MCP server works in Godot C# (.NET) projects: Claude Code or Cursor edits the .cs files, and Ziva's run_scene and get_godot_errors return Godot's C# build errors with file, line and error code, such as CS0266. Ziva's MCP server has no separate C# build or C# test tool, so a C# change is checked by running the scene or by the client running dotnet build itself, and you need the .NET version of Godot and the .NET SDK. Godot AI (hi-godot/godot-ai) says its C# support is text-only and that it does not build .NET or report compiler errors. Erodenn/godot-mcp-runtime's attach_script attaches a GDScript or C# script to a node.&lt;/p&gt;

&lt;h3&gt;
  
  
  Can a Godot MCP server run my game headless in CI?
&lt;/h3&gt;

&lt;p&gt;Ziva's MCP server cannot: Ziva's run_scene needs the Godot editor open on your computer. Coding-Solo/godot-mcp and Erodenn/godot-mcp-runtime launch Godot themselves from the command line with no editor addon, and godot-mcp-runtime adds a background mode that moves the game window off-screen. For pass or fail checks on every commit, scripted GUT or GdUnit4 input tests run headless without any AI client.&lt;/p&gt;

&lt;h3&gt;
  
  
  Can I use my own Claude or ChatGPT subscription in Godot?
&lt;/h3&gt;

&lt;p&gt;Yes. Sign in with your Claude Pro or Max, or ChatGPT Plus or Pro, account in Ziva's settings: no API key, and no Claude Code or Codex install. This works on every Ziva plan, including free Hobby, and chat requests use your Claude or ChatGPT plan's limits instead of your Ziva usage. How to connect: &lt;a href="https://ziva.sh/docs/existing-subscriptions" rel="noopener noreferrer"&gt;https://ziva.sh/docs/existing-subscriptions&lt;/a&gt;&lt;/p&gt;

</description>
      <category>godot</category>
      <category>mcp</category>
      <category>claudecode</category>
      <category>gamedev</category>
    </item>
  </channel>
</rss>
