How to package a custom runtime plugin to work in Blueprint-only projects?

So a while back I started working on a plugin that I wanted to post on FAB. The plugin is supposed to be easy to use and implement and should work in Blueprint-only projects projects as well as C++ ones, but since coding isn’t required (apart from blueprinting of course), I wanted compatibility with both.

The issue is, that when I package it or build it using a command, it always only gives me UnrealEditor files in the Binaries folder. The code does contain some editor-only content, but I have made sure that all of that has #if-statements around it and the build.cs.

What I expect is Binaries that work for both during the editor and runtime. It works during Editor, but when I package my Blueprint-only test project (which is empty except for that is has a map, and the level blueprint has my custom nodes in there), it always tells me that the plugin is missing, I expect this to be because the only Binaries my plugin makes, are Editor ones.

I have done quite a bit of research but cannot find the answer, hence, the forum post here.
Yes I do have my .uplugin set to runtime, it also is set to enabled in my project.

If you need more answers to be able to help, please check out my Github repo: GitHub - Cyndeon/Achievement-Plugin-UE5: This is my Achievement Plugin code for UE5

Any help would be much appreciated :smiley:

hi, @Cyndeon , compile your c++ code into a static library ( yourLib.a ) , after that you can use your static library both for Editor and runtime….

I suggest you take a deep look into MetaXR plugin for unreal , which can be found MetaXR Plugin

I understand I need a lib file but I dont understand how to make one that isnt for the editor.

I also looked through their example: GitHub - oculus-samples/Unreal-InteractionSDK-Sample: Sample projects to showcase the Meta XR Interaction SDK plugin. but didnt notice anything they did that I didnt do already.

You need to split your plugin’s functionality into two modules: Runtime and Editor.

I believe @YuriNK is right. After doing some more research, it appears that as long as my build.cs, even when wrapped in the if (Target.bBuildEditor), and my cpp and h files include editor-only headers it just won’t compile a runtime-only dll which I need.

Was hoping this wouldn’t be the issue, but I suppose it is time to split up the entire plugin.

Thanks to everyone who responded, I will go work on this for a good while, hope that it will be more obvious and easier to find this answer because I had a hard time finding the exact cause :smiley:

Alright nevermind. I split up my editor and runtime modules and made sure that the runtime one does not have anything in the build.cs related to editor-only modules and it still doesnt work.