

You'll be writing C++ wrappers that sit between the Unreal SDK and your Rust code and calls out to your Rust library's functions, and then re-formats and returns the result to Unreal via C++. So your project will have to be a mix of Blueprints, C++ and Rust, to be able to access all engine features.
#UNREAL ENGINE ON MAC VIDEO FORMAT UPDATE#
In fact, it can be done quite well if you use cxx as recommended above and then look into how the three older efforts did their porting, but update your methods to use cxx instead, for extra stability. There are three examples of people who have done that: ejmahler's recent effort is the best as far as I can see, and scape's semi-recent effort goes into great detail about how Rust FFI works in UE4/Unity, and then there's the oldest and most broken example by shadowmint. It means that you have to accept/return C++ pointers, and then manually map their values onto hand-crafted Rust structs, which in turn gets very complicated and very buggy when the Unreal Engine pointers refer to complicated classes with deep inheritance. Alternatively, you have to manually implement the FFI interop in Rust.But this would be by far the most stable and reliable option, because it automatically generates proper header files to let you interact with all the latest changes in the Unreal C++ SDK headers. You would however have to make a C++ project for Unreal Engine and then bind that C++ project to Rust. It's way better than bindgen, and creates safe interop between C++ and Rust. The best way for Rust-to-Unreal-Engine interop would be to write something using the new cxx ( thread) tool.

Several people have tried using Unreal Engine's FFI to load Rust modules, and it's definitely doable. What about writing your Unreal Engine game code in Rust? Look at this game studio who spent 75% of their game development time fixing ways that C++ allowed them to shoot themselves in the foot. Writing your Unreal Engine code in C++ is error-prone and it's the source of most bugs and game crashes. It's pretty low-level, and statically typed. This is a completely new language which reminds me of a mix of Python and Lua. Future Scripting Language (Unreal Verse): Tim Sweeney has been talking about this for almost a decade and now it's soon a reality.That's what I will go into more detail about soon. so files in Unreal Engine, which means that anything that can talk/emulate C/C++ will be able to talk to the engine. Foreign Function Interface (FFI): You are able to load arbitrary.And everything is unreliable, since they won't compile for all platforms that Unreal can target, nor do you have any guarantees that the "adapter" projects will live on since they're made by third parties, so you may be left in the dust with a bunch of game code that you'll have to port to another language in the future.

A few other language bindings exist, but nothing for Rust.
