Build Mode — Dynamic Floor Plugin
Build Mode
This page explains how to integrate the Dynamic Floor Plugin into a game’s construction mode — for example, a Sims-style building system where players place floors, switch materials, and toggle between different building tools.
Architecture overview
The plugin is designed so that you can slot it into any game structure. The key pieces on your side are:
- Your Player Controller — manages the active tool and forwards input
- Your HUD / UI — lets the player trigger placement with a chosen material
- Your boundaries — actors that define rooms/walls via the node network
- A renderer in the level — a Blueprint that implements
IFloorPolygonChangeListener
The plugin provides example implementations for all of these. You can use them directly or create your own.
Activating and deactivating floor placement
FloorPlacementControllerComponent has two lifecycle functions:
| Function | Description |
|---|---|
ActivateComponent | Enables the component — input forwarding to the active tool is live |
DeactivateComponent | Disables the component — input events are ignored |
Use these to switch between build mode and play mode in your game. For example:
- Player clicks Build Mode button →
ActivateComponent - Player presses Escape →
DeactivateComponent
Switching between tools
SetActiveTool on FloorPlacementControllerComponent sets the currently active placement tool.
The intended workflow per placement action:
- Player selects a floor type and material in the HUD.
- HUD calls
PlaceFloor(FloorType, FloorMaterial)on the controller (viaUiToControllerInterface). - The controller spawns a new tool actor and passes it to
SetActiveTool. - The player places the floor.
- After the tool is finished (or aborted), the component destroys the tool automatically.
Each tool has its own lifecycle — spawned fresh for each placement session, destroyed on completion or abort.
The PlaceFloor entry point
The recommended way to trigger tool spawning from a HUD is to implement UiToControllerInterface on your Player Controller and call PlaceFloor from your HUD Button click event.
Required parameters:
| Parameter | Type | Description |
|---|---|---|
FloorType | EFloorType | Which floor layer to place (Default, Border, Invisible) |
FloorMaterial | int32 | Material ID to apply to the placed polygon |
The example HUD is at:
DynamicFloorPlugin/Blueprints/ExampleGameplay/HUD
Use it as a reference, or build your own HUD that replicates the PlaceFloor button behaviour.
FloorType layering for multi-layer build systems
EFloorType allows you to operate multiple independent floor layers without them interfering with each other:
| Layer use case | EFloorType value |
|---|---|
| Visible floor tiles | Default |
| Wall boundary polygons | Border |
| Invisible logic/pathfinding layers | Invisible |
This means you can, for example, have a system where placing a wall creates a Border-type polygon, and placing floor tiles creates Default-type polygons — and neither affects the other’s database state or rendering.
Input forwarding
In your Player Controller, forward these inputs to FloorPlacementControllerComponent each frame/event:
| Input event | Component function |
|---|---|
| Left mouse click | HandleLeftClick |
| Right mouse click | HandleRightClick |
| Modifier key (e.g. Shift) | HandleShift |
| Tick (cursor position) | Forward cursor hit result on tick |
Combining with other build tools (e.g. a wall plugin)
Because the plugin uses EFloorType and FloorPlacementControllerComponent.DeactivateComponent, it is designed to coexist with other building systems (e.g. a separate wall placement plugin).
- When floor placement is active:
ActivateComponentonFloorPlacementControllerComponent - When wall placement is active:
DeactivateComponentonFloorPlacementControllerComponent, activate your wall tool instead
Each system stays isolated via these activation flags.
See also
- Floor Placement — detailed placement pipeline
- Materials — assigning materials through the HUD
- Quick Start — minimal setup reference
- Examples — complete build-mode example walkthrough