Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add docs on how to integrate with new & existing UE project #14

Open
tqwewe opened this issue Sep 8, 2022 · 2 comments
Open

Add docs on how to integrate with new & existing UE project #14

tqwewe opened this issue Sep 8, 2022 · 2 comments

Comments

@tqwewe
Copy link

tqwewe commented Sep 8, 2022

It would be nice to have some documentation on how to use this with an existing UE project, or even a brand new project.

So far, for adding to an existing project, I've copied over the RustPlugin to my Plugins directory, and the .dll into Binaries, but I'm not sure where to write my Rust code, and place my Cargo.toml... and how to link that project with my game.

@ameaninglessname
Copy link

ameaninglessname commented Sep 8, 2022

See the readme, thinking replacing the "example\RustExample" project with your project.

What it basically does (on windows) is :

  1. build the rust project into DLL (unreal_rust_example.dll here, using cargo build --release )
  2. Add "RustPlugin" to your project
  3. Copy the DLL to your project's Binaries folder and name it "rustplugin.dll" (hard-coded for now)
  4. Compile and run your project.

@MaikKlein
Copy link
Owner

MaikKlein commented Sep 8, 2022

So far, for adding to an existing project, I've copied over the RustPlugin to my Plugins directory,

Correct

and the .dll into Binaries, but I'm not sure where to write my Rust code, and place my Cargo.toml... and how to link that project with my game.

The dll is your game. If you want to write your own game, you can have a look at unreal-rust-example and maybe remove the things you don't want. If you compile that, it will produce a dll that you can copy into the Binaries folder.

Additionally you need to set the GameMode to ARustGameModeBase for your level.

I should provide a minimal example, but haven't had the time yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants