Course contentsShow
← Unreal Engine Game Development
Lesson 67 of 8801. Foundations and Editor WorkflowFree lesson

Extending the Unreal Editor with Custom Modules

Build editor-only modules that add custom tools, menus, or windows to the Unreal Editor interface to streamline your team's development workflow.

In this lesson, you will learn how to create a specialized editor-only module that injects custom tools directly into the Unreal Editor interface.

Why Editor Modules?

By default, your game modules contain code required for the actual gameplay (like Actors or Components). If you try to include code that draws a button in the Editor's menu, your game will fail to package because those "Editor-only" classes don't exist in a standalone game build.

By creating a separate module—marked as Editor type in your .uplugin or .uproject file—you isolate editor-only logic from your runtime game code. This allows you to build custom windows, menu items, or automated workflows that only trigger when a developer is using the engine.

Building Your Extension

To get started, you define a class that inherits from IModuleInterface. The critical step is implementing the StartupModule() function, where you hook into the FLevelEditorModule or FMenuBuilder to register your custom interface elements.

Here is a simplified look at how an editor module registers a new menu entry:

void FMyCustomEditorModule::StartupModule()
{
    // Get the Level Editor module to access its menu system
    FLevelEditorModule& LevelEditorModule = FModuleManager::LoadModuleChecked<FLevelEditorModule>("LevelEditor");

    // Extend the menu to add our custom button
    TSharedRef<FExtender> MenuExtender = MakeShareable(new FExtender());
    MenuExtender->AddMenuExtension("WindowLayout", EExtensionHook::After, nullptr, FMenuExtensionDelegate::CreateLambda([](FMenuBuilder& MenuBuilder)
    {
        MenuBuilder.AddMenuEntry(FText::FromString("My Custom Tool"), ...);
    }));

    LevelEditorModule.GetMenuExtensibilityManager()->AddExtender(MenuExtender);
}

By placing this code in a module with Type = "Editor" in your build configuration, you ensure that this code is only compiled and executed within the Unreal Editor. This keeps your production build clean while giving your team powerful, tailored tools to speed up their level design and asset management workflow.

Key Takeaway: Use Editor-only modules to isolate interface-extending logic from your game runtime, ensuring your project remains buildable while allowing for highly customized development tools.