Write a performance-critical system like pathfinding or physics in Rust and call it from GDScript in your Godot 4 game
Build a Godot editor plugin entirely in Rust using gdext GDExtension bindings
Mix Rust and GDScript in the same Godot project, using Rust where speed matters and GDScript for simpler game logic
Export a Godot 4 game with Rust logic to Android or iOS using gdext experimental mobile support
Requires both Godot 4 engine and Rust toolchain, mobile export targets need additional cross-compilation toolchain setup.
godot-rust/gdext is a library that lets you use the Rust programming language to write game logic for the Godot 4 game engine. Godot is a free, open-source tool for making 2D and 3D games, and it normally uses its own scripting language called GDScript. This library adds Rust as an alternative. The main benefit of using Rust instead of GDScript is stricter type checking and better performance for demanding parts of a game. The two languages can coexist in the same project: you can write performance-critical systems in Rust while keeping simpler game logic in GDScript. Rust code you write can also be called from GDScript in a type-safe way. The library works through Godot's GDExtension API, which is Godot's official mechanism for integrating languages other than GDScript. You define Rust structs that represent Godot objects (like sprites or player characters), apply some special annotations, and the library handles the connection between your Rust code and Godot's internal systems. Inheritance from Godot's built-in classes is done through composition: you include a Base field in your struct rather than subclassing in the traditional sense. As of 2023 the library has matured enough for use in real projects, including games, editor plugins, and other Godot-based tools. Most of Godot's built-in APIs have been mapped to Rust. The development team notes that occasional breaking changes do happen, but they provide migration guides and follow standard versioning rules. There is experimental support for building games for web browsers, Android, and iOS, though documentation for those platforms is still limited. To get started, the README points to a dedicated book with tutorials and API reference documentation, plus a repository of demo projects and example games. The license is the Mozilla Public License 2.0, which allows commercial use and lets you keep your own game code private as long as any changes to the library itself are shared.
← godot-rust on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.