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

Developing Custom Editor Modes for Level Editing

Create specialized editor modes that provide unique interaction handles and toolsets for placing or manipulating specific game objects in the viewport.

In this lesson, you will learn how to create specialized Editor Modes that provide custom interaction handles and toolsets for placing or manipulating specific game objects in the viewport.

Moving Beyond Standard Tools

By default, Unreal Engine provides standard tools like Translate, Rotate, and Scale. However, when working on complex systems—like a procedural road builder or a specialized grid-based placement system—standard tools are often inefficient. Custom Editor Modes allow you to define "Editor-only" logic that triggers when your specific mode is active, effectively turning the Viewport into a bespoke application for your designers.

The Core Concept: Mode Handlers

To create a custom mode, you typically extend FEdMode. This class acts as a state machine that controls what happens when your mode is selected in the Editor Modes panel.

The power of a custom mode lies in overriding input and interaction methods. For instance, you can capture mouse clicks in the 3D viewport to spawn actors or draw visual debug shapes (like custom handles or lines) to guide placement.

Consider a simplified logic flow for a "Fence Builder" mode:

// Inside your custom FEdMode class
bool FMyFenceMode::HandleClick(FEditorViewportClient* InViewportClient, HHitProxy* HitProxy, const FViewportClick& Click)
{
    if (bIsPlacingFence)
    {
        // Custom logic to place a Fence Actor at the clicked location
        PlaceFenceAtLocation(Click.GetClickLocation());
        return true; // Consume the input
    }
    return false;
}

Why Use Custom Modes?

Unlike Editor Utility Widgets (which live in separate panels), a Custom Editor Mode lives inside the Viewport itself. This allows you to:

  1. Context-Aware Interaction: Change the behavior of existing tools while your mode is active.
  2. Visual Feedback: Draw custom Gizmos or line representations that aren't part of the game world but help designers visualize placement, such as snapping distances or rotation arcs.
  3. Streamlined Workflow: Reduce the number of steps required to modify specific complex actors, minimizing the need for repetitive data entry in the Details Panel.

By mapping specific viewport behaviors to your custom logic, you move from "editing a scene" to "authoring a game feature."

Key Takeaway: Custom Editor Modes bridge the gap between general-purpose manipulation tools and specialized gameplay requirements, allowing you to create a tailored, intuitive interface directly within the 3D Viewport.