I tried to fix it by moving the code dependent on “UnrealEd” to yet another module, let’s call this module “PluginEditor”.
So now my plugin has two modules - “PluginRuntime” and “PluginEditor”
and [plugin].uplugin
contains:
"Modules": [
{
"Name": "PluginEditor",
"Type": "Editor",
"LoadingPhase": "PreDefault"
},
{
"Name": "PluginRuntime",
"Type": "Runtime",
"LoadingPhase": "Default"
}
]
[project].Build.cs
contains:
PrivateDependencyModuleNames.AddRange(new string[]{"PluginCore",});
PluginCore.Build.cs
contains:
PrivateDependencyModuleNames.AddRange(new string[]{"PluginEditor",});
and PluginEditor.Build.cs
contains:
PrivateDependencyModuleNames.AddRange(new string[]{"UnrealEd",});
According to Plugins in Unreal Engine | Unreal Engine 5.2 Documentation
this now should build in the Shipping, right? Right???
NO, it doesn’t, at least not for me:
Unable to instantiate module 'UnrealEd': Unable to instantiate UnrealEd module for non-editor targets.
(referenced via Target -> PluginCore.Build.cs -> PluginEditor.Build.cs)
(toooo bad…)
I have no idea what I’m doing wrong.
Feeling hopeless at this point.