This skill guides an agent writing Godot 4.7 game code in C#. It checks the toolchain (the .NET editor build and a .NET 8 SDK, or 9 for Android), makes every script a public partial class whose name matches its file, and uses the PascalCase lifecycle methods with double delta.
It includes patterns for a CharacterBody2D script with [Export] properties, signals declared as event handler delegates, instancing a PackedScene, and calling GDScript from C#. The gotchas cover build errors from non-partial classes, string-based engine calls that need snake_case names, struct copies and C# export limits.
What You Get
- A workflow from toolchain check through partial classes, lifecycle overrides and signals to build and smoke run
- C# patterns for a node script, signals as C# events, instancing a scene and calling GDScript
- Build and log-scan commands that catch errors Godot reports with exit code 0
- A gotcha list covering class and file names, export visibility, disposed objects, struct edits and web and Android export limits
Common Use Cases
- Writing a Godot player controller or health component in C#
- Porting GDScript code to C# with correct PascalCase and double delta
- Fixing a Cannot find class error or an [Export] that is missing in the Inspector
- Working out why a C# project will not export to web or Android
What Makes It Unique
The skill states the facts that decide whether C# works at all in Godot 4: the .NET editor build, partial classes for the generators, snake_case names in string calls, no web export, and a net9.0 switch for Android. It tells the agent to build with dotnet first, because Godot’s runtime does not compile C# and a headless run would use stale output.
Under The Hood
The agent loads the SKILL.md and, when needed, a reference on the .csproj, NuGet, export attributes, collections and platform export notes. It then runs commands in your project: dotnet build on the csproj, a headless run of the .NET Godot binary with the log redirected to a file and searched with grep, and optionally the Python project checker from the godot-nodes-scenes skill. These commands read project files and write build output and log files. The skill makes no network calls of its own, though a dotnet build may restore NuGet packages.