Setup

Before we can start creating a hello-world project using godot-rust, we'll need to install the necessary software.

Godot Engine

The default API version is currently 3.2.3-stable. For the rest of the tutorial, we'll assume that you have Godot 3.2.3-stable installed, and available in your PATH as godot.

You may download binaries of Godot 3.2.3-stable from the official repository: https://downloads.tuxfamily.org/godotengine/3.2.3/.

Using another build of the engine

For simplicity, we assume that you use the official build of 3.2.3-stable for the Getting Started tutorial. If you want to use another version of the engine, see the Using custom builds of Godot guide.

Rust

rustup is the recommended way to install the Rust toolchain, including the compiler, standard library, and Cargo, the package manager. Visit https://rustup.rs/ to see instructions for your platform.

After installation of rustup and the stable toolchain, check that they were installed properly:

# Check Rust toolchain installer version
rustup -V
# Check Rust version
rustc --version
# Check Cargo version
cargo -V

Windows

When working on Windows, it's also necessary to install the Visual Studio Build Tools, or the full Visual Studio (not Visual Studio Code). More details can be found on Working with Rust on Windows.

LLVM

The godot-rust bindings depend on bindgen, which in turn depends on LLVM. You may download LLVM binaries from https://releases.llvm.org/.

After installation, check that LLVM was installed properly:

# Check if Clang is installed and registered in PATH
clang -v

Using the template

We also provide an experimental template to get you started right away. All the boilerplate stuff is already done for you. If you have decided to use the template, you can skip section 2.2. Check out the wiki for instructions.

The template is currently a work-in-progress, and might not work in all setups where the base library would be compatible. If you encounter any issues with the template, please report them at its issue tracker.

Setup

$ cargo install cargo-generate

Usage

$ cargo generate --git https://github.com/godot-rust/godot-rust-template --name my-awesome-game
$ cd my-awesome-game
$ make run