Hello, everyone. I have a problem that somehow I need to build the Import function in the assembled game. In the editor everything works well and correctly, but if you build the project, you need to use the #if WITH_EDITOR macro. But this macro does not add the function to the built game, I tried to change the value in .target.cs, but although it says that the macro value has changed, but the built game will not change. I also tried to change the value inside the Unreal Engine, but then unreal stops compiling because of some libraries that work only when WITH_EDITOR = O. Is there any way to solve the problem? Thank you for your help!
Знімок екрана 2025-03-09 143448|690x219
#if WITH_EDITOR is a macro that checks if you are in the editor. It is not to enforce that editor functions are included into the packed game. It’s the other way around.
Elements marked with
#if WITH_EDITOR
#endif
will be stripped out of the shipped build.
You cannot add editor only functionality to your shipped game.