Data and some images on the original website: https://godot-rust.github.io/
1. Download Godot Engine
Download and install Godot Engine from the official website.
2. Install Rust
Use the following commands in your terminal:
# Linux (distro-independent)
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
# Windows
winget install -e --id Rustlang.Rustup
# macOS
brew install rustup
Once installation is complete, continue to the next step.
3. Create the Project Structure
Set up your folders like this:
project_root/
├── rust/
└── godot/
4. Create the Rust Project
Create the Rust project in the root folder, then rename it to rust and using your terminal:
cargo new <project_name> --lib
This will generate a Cargo.toml file like this:
[package]
name = "rust_project"
version = "0.1.0"
edition = "2021"
[lib]
crate-type = ["cdylib"]
Add the dependency:
[dependencies]
godot = "0.5.1"
Or use the latest version from GitHub:
godot = { git = "https://github.com/godot-rust/gdext", branch = "master" }
5. Create the Godot Project
Create your Godot Engine project inside the root folder (project_root/godot).
You don’t need to move anything here because:
- The
.gdextensionfile will reference this location correctly
If you want to export your game (e.g., for Linux), you can check demo projects here
6. Create the .gdextension File
Inside the godot folder, create a file named:
Define the export paths inside this file.
You can create it using:
- VS Code
- Or your system file explorer
7. Try the Demo or Build Your Own
-
To run the project, use the
cargo buildcommand in your system terminal or the terminal in VS Code. - Then switch back to the Godot Engine editor and press F5 or click the ▶️ button in the top-right corner to run the game.
Backup Your Project
If you want to back up your project:
-
Run
cargo cleanIn your system terminal or in the VS Code terminal, to remove build artifacts and reduce project size. -
Compress (zip) the entire root folder, including both the
rustandgodotdirectories.
This ensures that all source code and project configurations are preserved.
You can restore the project later by running cargo build again.



No comments:
Post a Comment