OpenParable
Skip to content
← Back to skills

Godot Csharp

Development
godot-csharp

Godot Csharp is an Agent Skill for development published in the a5c-ai/babysitter repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.

Godot C# programming skill for .NET integration, scripting patterns, and performance optimization.

View on GitHub ↗
QUICK START

How to use this skill

Bring this guide into your coding agent with a prompt tailored to the tool you use.

  1. Open your project in Codex.
  2. Copy and paste the prompt below.
  3. Review files and risks before approving any action.
Prompt to paste
Inspect the Agent Skill at https://github.com/a5c-ai/babysitter/blob/HEAD/library/specializations/game-development/skills/godot-csharp/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/godot-csharp, but wait for my approval before writing files or running scripts.

Copying this prompt does not install or run the skill. Review third-party files before use.

Godot C# Skill

C# programming for Godot Engine development.

Overview

This skill provides capabilities for implementing game logic using C# in Godot, leveraging .NET integration.

Capabilities

C# Integration

  • Node class inheritance
  • Attribute-based exports
  • Signal definitions
  • Callable system

.NET Features

  • NuGet packages
  • Async/await patterns
  • LINQ queries
  • .NET libraries

Interoperability

  • Call GDScript from C#
  • Expose to GDScript
  • Handle Variant types
  • Manage signals

Performance

  • Struct usage
  • Memory management
  • Object pooling
  • Span usage

Prerequisites

  • Godot 4.0+ with .NET support
  • .NET SDK installed
  • C# IDE (VS Code, Rider)

Usage Patterns

Node Script

using Godot;

public partial class Player : CharacterBody2D
{
    [Export]
    public float Speed { get; set; } = 200f;

    [Signal]
    public delegate void HealthChangedEventHandler(int newHealth);

    private int _health = 100;

    public override void _Ready()
    {
        // Initialize
    }

    public override void _PhysicsProcess(double delta)
    {
        var velocity = Vector2.Zero;
        velocity.X = Input.GetAxis("move_left", "move_right");
        velocity.Y = Input.GetAxis("move_up", "move_down");
        Velocity = velocity.Normalized() * Speed;
        MoveAndSlide();
    }
}

Signal Connection

button.Pressed += OnButtonPressed;
// or
button.Connect("pressed", Callable.From(OnButtonPressed));

Best Practices

  1. Use partial classes
  2. Leverage NuGet packages
  3. Handle node lifecycle
  4. Profile memory usage
  5. Use source generators

References