MCPcopy Index your code
hub / github.com/MaikKlein/unreal-rust

github.com/MaikKlein/unreal-rust @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
466 symbols 731 edges 61 files 11 documented · 2%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

🦀 unreal-rust

Opinionated Rust integration for Unreal Engine

Build Status LICENSE LICENSE Discord

☣️ Warning

unreal-rust is not ready to be used in a real project. unreal-rust is in a very early state and nothing more than a proof of concept right now. The API will change quite frequently. Things might crash, or not work as intended. The user experience will not be great.

I am releasing unreal-rust on github to develop it in the open.

🎯 Features

  • Simple opinionated bindings: Easy access to core APIs like playing sounds, spawning actors, pathfinding, physics etc.
  • Developer friendly: Fast iteration times with hot reloading in the editor and during live play. Panics are caught and do not crash the editor
  • Editor integration: Add Rust components to actors in the editor, or access Rust components from Blueprint to drive animations.
  • Entity Component System: unreal-rust is built on top of an ECS.
  • Built on top of AActor: Most gameplay features like GameMode, Characters, GameState, GAS are not directly accessible in unreal-rust. Instead unreal-rust will provide optional alternatives. But you can still interact with most parts of the engine as Rust components can be accessed in Blueprint.
  • No engine modifications: unreal-rust is only a Plugin, just drop it in your project. See Supported versions for more information.
  • Samples: The development of unreal-rust is heavily driven by samples.
  • Free: Dual licensed under MIT/APACHE

🖥️ Supported Platforms

  • 🐧 Linux
  • 🪟 Windows

Potential future platforms: iOS, macOS, Android, html5/browser(possibly)

Consoles are unsupported. I simply can not offer console support as it is a closed off ecosystem. Nor do I have access to any developer kits myself.

💌 Blog posts / media

🚩 Known problems

  • This is just a hobby project of mine that I work on outside of my normal work hours. I might be slow to respond to issues, questions, feature requests, or PR reviews.

🦮 Getting started

Running the example

I am aware that these are a lot of steps. I am sorry, I will try to simplify this in the future

  • Prerequisites:
    • Get git lfs, and run git lfs install
    • ue4cli, You can get it with pip3 install ue4cli. This step is optional but I will use ue4cli in this guide.

We start by cloning this repository

git clone https://github.com/MaikKlein/unreal-rust

Next we clone the submodule. This will download the actual example with all the assets.

cd unreal-rust
git submodule update --init

Next we need to setup the example

    • Linux sh setup.sh
    • Windows setup.bat

This will symlink the RustPlugin into the unreal example/RustExample/Plugin folder.

Now we need to build the actual Rust code:

Simply run

cargo build --release

This will build the whole project. This also produces our dll that we are going to load into Unreal.

Copy the dll/so file into the project

  • Linux: cp target/release/libunreal_rust_example.so example/RustExample/Binaries/rustplugin.so
  • Windows: copy .\target\release\unreal_rust_example.dll .\example\RustExample\Binaries\rustplugin.dll

Now we need to build the unreal example

cd example/RustExample
ue4 build Development Editor

Now you can run the example with ue4 run

🚀 Supported versions

  • 5.0

This project will always try to support the latest version.

  • Latest version of Unreal
  • Latest version of Rust
  • Latest version of all dependencies

🤝 Alternatives

🥰 Thank you

Extension points exported contracts — how you extend this code

GetEditorComponentValue (Interface)
(no doc) [6 implementers]
unreal-api/src/editor_component.rs
ReflectDyn (Interface)
(no doc) [6 implementers]
unreal-reflect/src/registry.rs
Plugin (Interface)
(no doc) [2 implementers]
unreal-api/src/plugin.rs
ReflectStatic (Interface)
(no doc) [6 implementers]
unreal-reflect/src/registry.rs
InitUserModule (Interface)
(no doc) [1 implementers]
unreal-api/src/module.rs
TypeUuidDynamic (Interface)
(no doc) [1 implementers]
unreal-reflect/src/lib.rs
UserModule (Interface)
(no doc) [1 implementers]
unreal-api/src/module.rs
TypeUuid (Interface)
(no doc)
unreal-reflect/src/lib.rs

Core symbols most depended-on inside this repo

bindings
called by 42
unreal-api/src/module.rs
ToAActor
called by 22
RustPlugin/Source/RustPlugin/Private/RustUtils.cpp
ToFVector
called by 19
RustPlugin/Source/RustPlugin/Private/RustUtils.cpp
get
called by 18
unreal-api/src/editor_component.rs
ToVector3
called by 17
RustPlugin/Source/RustPlugin/Private/RustUtils.cpp
ToFQuat
called by 9
RustPlugin/Source/RustPlugin/Private/RustUtils.cpp
get_collision_shape
called by 8
unreal-api/src/physics.rs
from_ffi_uuid
called by 8
unreal-api/src/core.rs

Shape

Class 163
Method 150
Function 114
Enum 29
Interface 10

Languages

Rust53%
C++46%
C#1%

Modules by API surface

unreal-api/src/core.rs65 symbols
RustPlugin/Source/RustPlugin/Private/Bindings.cpp42 symbols
RustPlugin/Source/RustPlugin/Public/Bindings.h37 symbols
unreal-ffi/src/lib.rs31 symbols
gameplay-plugins/unreal-movement/src/lib.rs25 symbols
unreal-rust-example/src/lib.rs22 symbols
unreal-api/src/module.rs19 symbols
unreal-api/src/physics.rs16 symbols
RustPlugin/Source/RustPlugin/Private/RustPlugin.cpp16 symbols
unreal-reflect/src/registry.rs13 symbols
RustPlugin/Source/RustPlugin/Public/RustPlugin.h13 symbols
RustPlugin/Source/RustPlugin/Private/RustUtils.cpp12 symbols

For agents

$ claude mcp add unreal-rust \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact