gdextension

Build native C++ or Rust extensions for Godot 4.x using GDExtension bindings.

657|31|Updated Apr 3, 2026
One-click install
npx skills add https://github.com/jame581/GodotPrompter --skill gdextension
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: gdextension
Source: https://github.com/jame581/GodotPrompter/tree/main/skills/gdextension
Command: npx skills add https://github.com/jame581/GodotPrompter --skill gdextension

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Writing performance-critical code or wrapping existing C/C++ libraries in Godot requires native extensions, but the GDExtension setup — godot-cpp submodules, SCons builds, class binding, and .gdextension configuration — is error-prone and version-sensitive. This Skill guides the full workflow so the extension compiles, loads, and interoperates with GDScript and C# correctly.

Core Features & Use Cases

  • Class Binding in C++: Register native classes with GDCLASS, ClassDB::bind_method, ADD_PROPERTY, and ADD_SIGNAL so they appear as normal Godot node types with Inspector properties and signals.
  • Build & Configuration: Set up the godot-cpp submodule on the correct engine branch, build with SCons, and author the .gdextension file with matching entry_symbol, compatibility_minimum, and per-platform library paths.
  • Rust Alternative & Debugging: Use the community gdext crate for Rust extensions, hot-reload debug builds, and attach native debuggers or sanitizers to the running engine.
  • Use Case: You profiled a hot path that GDScript cannot keep up with. Follow this Skill to wrap the logic in a C++ GDExtension class, expose it to GDScript, and ship debug and release binaries for Windows, macOS, and Linux.

Quick Start

Help me create a GDExtension in C++ for Godot 4.3 that exposes a custom Sprite2D node with bindable properties and signals.

Frequently Asked Questions about gdextension

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a GDExtension for Godot 4 in C++?

Add godot-cpp as a git submodule on the branch matching your engine version, write a class using GDCLASS and _bind_methods, and build with SCons. Then create a .gdextension file whose entry_symbol matches your exported extern "C" init function and lists per-platform library paths.

When should I use GDExtension instead of GDScript or C#?

Use GDExtension only when you need native speed in a profiled hot loop, must wrap an existing C/C++ library, or are building a language binding. GDScript and C# cover almost all game logic, and GDExtension is more complicated to use.

Can I write Godot GDExtensions in Rust?

Yes, the community-maintained godot-rust/gdext crate supports Rust extensions as cdylib libraries requiring Godot 4.2 or later. You declare classes with #[derive(GodotClass)], expose methods with #[func], and use the fixed entry symbol gdext_rust_init.

Does a GDExtension built for Godot 4.3 work in 4.2?

No, GDExtension compatibility is forward-but-not-backward: an extension targeting 4.2 works in 4.3, but one targeting 4.3 will not load in 4.2. Set compatibility_minimum to the lowest engine version you support.

Why does my GDExtension node type disappear in exported games?

The export is missing the template_release binaries listed in the .gdextension [libraries] section. Release exports need the optimized release library for each target platform and architecture, or the native node type will not exist at runtime.

How do I debug native C++ code in a Godot extension?

Build with debug symbols, launch the editor or game, and attach GDB, LLDB, or Visual Studio to the Godot process. Enable reloadable = true for hot reload during development, and use sanitizer builds to catch memory and undefined-behavior bugs.