Install the skill above, then run this in your AI tool:
/godot-csharp <your description>
About
Write Godot game code in C# that the source generators accept, build it from the command
line, and check it runs. Targets **Godot 4.7 .NET** with the **.NET 8** SDK (9 for
Android). Read the `.csproj` first: its `Sdk="Godot.NET.Sdk/x.y.z"` is the engine version.
Source
What gets added to your project
Preview every file this package writes on install before you run the command above.
Summary
>
Skill instructions
Godot C# / .NET (4.x)
Write Godot game code in C# that the source generators accept, build it from the command
line, and check it runs. Targets Godot 4.7 .NET with the .NET 8 SDK (9 for
Android). Read the .csproj first: its Sdk="Godot.NET.Sdk/x.y.z" is the engine version.
Workflow
Confirm the toolchain. The project needs the Godot .NET editor build (the
standard build cannot load C#) and a .NET SDK: dotnet --list-sdks should show 8.0 or
later, and 9.0 or later if the project exports to Android.
Every script is a public partial class whose name matches its .cs file name and
that extends a Godot type. The generators that wire [Export], [Signal] and method
bindings only work on partial classes.
Override lifecycle methods in PascalCase with double delta: _Ready(),
_Process(double delta), _PhysicsProcess(double delta).
Signals: a [Signal] delegate named XxxEventHandler becomes the Xxx signal, an
Xxx C# event and SignalName.Xxx. Emit with EmitSignal(SignalName.Xxx, ...).
Verify before you finish:
Build: dotnet build <project>.csproj from the project folder must exit 0 with no
errors. Godot's runtime does not compile C#, so a headless run uses whatever was built
last. (godot --headless --build-solutions --quit also builds, through the editor.)
Smoke run with the .NET editor binary: godot --headless --path <project> --quit-after 300 > run.log 2>&1,
then grep -nE "SCRIPT ERROR|^ERROR:" run.log. An unhandled exception in a callback is
logged as an ERROR: with its stack trace and the game keeps running, so the exit code
stays 0.
If godot-nodes-scenes is installed, python3 ../godot-nodes-scenes/scripts/check_godot_project.py <project>
catches broken script and scene paths in .tscn files.
For behaviour tests in CI, follow godot-gdscript-headless-testing; build before the
test step.
publicpartialclassSpawner : Node2D
{
privatestaticreadonly PackedScene Bullet = GD.Load<PackedScene>("res://bullet.tscn");
publicvoidShoot(Vector2 at)
{
var b = Bullet.Instantiate<Node2D>();
b.Position = ToLocal(at); // world -> this parent's space, before _Ready runs
AddChild(b);
}
}
4. Calling GDScript from C#
csharp
Node gd = GetNode("Enemy"); // a node with a .gd script
gd.Call("take_damage", 10); // snake_case names, checked at runtimeint score = gd.Get("score").AsInt32();
gd.Connect("died", Callable.From(OnDied));
Gotchas
Cannot find class X for script res://X.cs → the class name differs from the file name.
Build errors from generated code, or [Export] missing in the Inspector → the class is
not partial, or the project was not rebuilt. The Inspector only shows members from the
last successful build.
CallDeferred("AddChild", node) does not work → string-based engine calls (Call,
CallDeferred, Get, Set, Connect) use the engine's snake_case names. Pass
MethodName.AddChild (or "add_child") instead.
An override never runs → wrong case or signature (_process, or float delta).
C# uses PascalCase and double.
[Signal] not found → the delegate name must end in EventHandler; the signal is the
name without it.
ObjectDisposedException inside a signal handler → the receiver was freed while the
emitter lived on, and Godot could not disconnect it because the signal is a custom
[Signal] or the handler is a lambda that captures variables. Unsubscribe with -= in
_ExitTree() (Pattern 2), and check GodotObject.IsInstanceValid(node) before using
nodes that may be gone.
Editing Velocity.X will not compile → Vector2, Color and Transform2D are
structs. Copy, change, assign back.
A cross-language call does nothing → names are not translated: GDScript calls a C#
node by its C# names (node.TakeDamage(10)), C# calls GDScript by its snake_case names
(Call("take_damage", 10)). A Call() with the wrong number of arguments fails without
an error, so assert on the effect in a test.
Console.WriteLine output is missing → use GD.Print/GD.PrintErr/GD.PushError so
it reaches the Output panel and log file.
Web export fails → C# projects cannot export to the web in Godot 4. Android and iOS
work but are experimental, and iOS exports need macOS.
Android export fails but desktop works → the generated .csproj switches to
net9.0 for Android, so the .NET 9 SDK is required. Keep that condition when editing the
file.
References
Read references/csharp-setup-and-interop.md for .csproj details and NuGet, export
attribute variants, Godot.Collections vs System.Collections, await ToSignal(...),
[GlobalClass] resources, a GDScript-to-C# API table, and per-platform export notes.
Related skills
godot-gdscript: the GDScript equivalents of these patterns.
godot-signals-groups: signal architecture, language-neutral.
godot-resources: data resources; [GlobalClass] is C#'s class_name.
godot-export: presets and command-line exports.
unity-csharp-scripting: C# in Unity, for developers coming from there.
Version notes
Last verified: 2026-11-11 against the Godot 4.7.2 docs and engine source (C# was not built or
run for this check).
Godot 4.7.2 (August 2026) is the current stable release; 4.8 is in beta.
SDK minimums: .NET 8 or later, .NET 9 or later for Android exports. The generated
.csproj targets net8.0 and net9.0 when GodotTargetPlatform is android.
Web export: not supported for C# in Godot 4. Android and iOS: experimental since 4.2.
Add this badge to a GitHub README so readers can open the package page and install the same version.
[](https://www.aipm-registry.com/skills/gamedev-skills/godot-csharp/1.0.0?utm_source=github&utm_medium=readme&utm_campaign=package_badge)
This imported publisher has not claimed its AIPM account. A connected account confirms account control, but it does not guarantee that a package is safe.
AI assistant context
What this skill is for
@gamedev-skills/godot-csharp@1.0.0 is an AIPM skill package for All tools. Use it when a project needs the reusable AI behavior described as: >
Run aipm add @gamedev-skills/godot-csharp@1.0.0 in a project that has AIPM initialized.
Supported tools
@gamedev-skills/godot-csharp@1.0.0 supports All tools.
Before installing
AIPM skills can add files to your project. Review the package name, target, description, license, and publisher before installing. Use a clean branch when trying a new skill.