UERust is a CLI-driven toolkit designed to bridge the gap between Rust and Unreal Engine (C++). It provides a robust, no-nonsense foundation for bi-directional FFI and dynamic library hot-reloading. Unlike opinionated frameworks, UERust acts as the "plumbing" layer, allowing you to focus on logic rather than fighting the build system.
- ✅ Cross-platform builds: Compile for Mac, Windows, and Android from any host system
- ✅ Automatic bindings generation: Generate C/Rust FFI bindings from JSON configuration
- ✅ Unreal Engine plugin integration: Auto-generate plugin boilerplate and integrate with UE subsystems
- ✅ Flexible API definitions: Define C-callable and Rust-callable functions with comprehensive type support
- ✅ Seamless workflow: Build, bind, and deploy Rust code to Unreal Engine projects
- ✅ Type-safe FFI: Comprehensive type mapping between C and Rust
- ✅ Lightweight & minimal: Designed to do only one thing well: bridge basic types and enable reliable plugin reload. No abstractions, no opinionated frameworks — just the bare essentials to get Rust code running and reloading in Unreal Engine. Complex functionality (actors, UObject wrappers, Blueprints, async, etc.) is intentionally left to be built on top of this foundation.
💡 Philosophy: UERust is a toolkit, not a framework. It avoids over-engineering and stays focused on the critical path: FFI, build automation, and hot-reload. Everything else — memory management strategies, UObject integrations, Blueprint bindings, async runtimes — is deliberately omitted so you can layer exactly what you need, without fighting against built-in assumptions.
# Install from source
cargo install --path .
# Or build and run directly
cargo build --release
./target/release/uer --help- Install the tool:
cargo install --path .(ensure~/.cargo/binis in yourPATH) - Navigate to your Unreal project:
cd /path/to/your/project(directory containing your.uprojectfile) - Configure your C++ Module: Ensure a project-level C++ module exists within your project directory. In its
.Build.csfile, addUERustto thePublicDependencyModuleNameslist. - Initialize the plugin: Run
uer gen— this createsUERustPlugin/and generates:- Plugin configuration (
UERustPlugin.uplugin) and build files - A deriviable C++ base class module implementation
UERustModuleImpl.h. bindings.rscontains the Rust bindings. Auerust_loadedfunction must exist in the module root to allow the module to initialize.
- Plugin configuration (
- Define your API: Create
api.jsonin your project root and add your function definitions - Regenerate bindings: Run
uer genagain whenever you modifyapi.json - Build and run: Execute
uer buildto compile the Rust code into a dylib that Unreal Editor will automatically reload
To wire your primary C++ game module into the UERust architecture, open your project's main .cpp file (typically named after your project, e.g., YourProjectName.cpp) and apply two minor changes:
#include "Modules/ModuleManager.h"
#include "UERustModuleImpl.h" // <--- 1. Add this include
// 2. Change first argument to FUERustModuleImpl (or a class that derives from it)
IMPLEMENT_PRIMARY_GAME_MODULE(FUERustModuleImpl, ...);src/: Rust CLI implementationschema.json: JSON Schema for API definitionsCargo.toml: Rust project configurationMakefile: Simple installation helper
💡 Note:
UERustPlugin/is generated automatically byuer genin your Unreal Engine project directory — it is not part of the UERust tool's source code.
Define your Rust and C functions in api.json:
{
"cfunc": {
"add": {
"doc": "Add two integers",
"ret": "i32",
"args": [{"a": "i32"}, {"b": "i32"}]
}
},
"rfunc": {
"get_version": {
"doc": "Get plugin version string",
"ret": "&str",
"args": []
}
}
}Supported types: bool, u8, i8, u16, i16, u32, i32, u64, i64, f32, f64, *f64, *mut f64, usize, isize, c_void, *c_void, *mut c_void, *u8, &str, String
When using Rust for plugin development, Unreal Editor automatically detects changes to the compiled Rust dylib (e.g., after running uer build) and reloads it without requiring a manual editor restart. This enables rapid iteration — simply run uer build to update the dylib, and Unreal Editor will automatically detect and load the new version. Note that this automatic reload behavior applies to Rust dylibs but not to C++ modules, which require manual compilation and editor restart.
Initialize the UERust plugin in your Unreal Engine project and generate C++ bindings. This command:
- Creates the
UERustPlugin/directory structure in your project - Generates
UERustPlugin/Source/UERust/Public/bindings.handUERustPlugin/Source/UERust/Private/bindings.cpp - Sets up the plugin configuration (
UERustPlugin.uplugin) and build files - Creates
UERustModuleC++ implementation files if your project has a local module - Updates the Unreal Engine project to recognize the new plugin
Compile your Rust code into a dynamic library (dylib) and place it in the appropriate location for Unreal Engine to load.
--target-os: Target OS (Mac, Win64, Android)--variant: Build variant (debug/release)--module-name: Module name (default:UERust)
💡 After
uer buildcompletes, Unreal Editor automatically detects the updated dylib and reloads it without requiring a restart.
Build for Android with NDK support.
--android-ndk-root: Path to Android NDK--abi: Android ABI (arm64-v8a, armeabi-v7a)--target-triple: Rust target triple
UE_PROJECT_DIR: Path to your Unreal Engine project directoryANDROID_NDK_ROOT: Path to Android NDK (for Android builds)
- Rust 1.78+ (with
cargo) - Unreal Engine 5.0+
- For Android builds: Android NDK r21+
- For Windows builds: Visual Studio 2022+ (or MSVC toolchain)
MIT License - see LICENSE file
Contributions are welcome! Please see our CONTRIBUTING.md for guidelines.
- Built with Clap for CLI parsing
- Uses XShell for shell command execution
- Leverages include_dir for plugin template embedding
UERust - Bridge the gap between Rust's performance and Unreal Engine's power.