How to rebuild an Engine Plugin?

When I create plugins inside my game folder I’m able to adjust the plugin files and recompile them from within my game project .sln.

But whenever I put plugins inside the engine folder they won’t recompile from within visual studio. I regenerated the project and they are visible inside the UE4/plugins folder in the solution explorer.

Am I missing something in my .cs files or anything else?

You need to build the engine from source to do so plugin in there build with it, you can try to use command line there is -plugin option in UBT (you can use it with build.bat) but not sure exacly how it works

You also don’t need to rebuild, you can copy paste module dll in plugin and it should work

1 Like

Thanks Shadow river, I will look into the -Plugin option, if it doesn’the work I will go for the engine source.

I did copy it and it worked but since I use it for several projects and update it often it feels silly to move it around all the time.

I tried this and it didn’t work.
I double-checked the UBT source code in order to figure out where the -plugin option is supposed to go, and whether or not it needs to be followed by the name of the plugin, but I found that no “-plugin” argument is ever parsed by UBT. The string simply does not exist in UnrealBuildTool.cs.

according to this tutorial (UE4 - recompiling plugins (Windows & Linux) - YouTube) the command should be something like this, compiling the final plugin into the [TempFolder]:

"C:\Program Files\Epic Games\UE_4.17\Engine\Build\BatchFiles\RunUAT.bat" BuildPlugin -plugin="C:\Program Files\Epic Games\UE_4.17\Engine\Plugins\[...]\YourPlugin.uplugin" -package="[TempFolder]"

■■■■! this cmd will delete everything in TempFolder, what’s more it fails.

I managed to successfully build dll’s of a plugin with this command. Thanks!

Note that [TempFolder] will by default be put under C:\Program Files\Epic Games\UE_4.17 (in this example).

I also had to make sure the .NET desktop development was installed with my Visual Studio using the Visual Studio Installer.

Actually the process failed at the end, but it seems it built the Win64 dlls before exiting, so I was able to copy them and replace the old ones, which was just what I needed.

I’m developing on Win64 platform and adding -TargetPlatforms=Win64 resulted in a success for me.