Examples — Dynamic Floor Plugin
Examples
Concrete scenarios showing how to use the Dynamic Floor Plugin.
Example 1 — Explore the example map
The fastest way to understand the system.
- In the Content Browser, open:
DynamicFloorPlugin/Maps/Preview_DynamicFloorPlugin - Press Play.
- Left-click to place a floor tile. Right-click to abort. Press Shift to toggle fill mode.
From here, open the following Blueprints to see how everything is connected:
FloorPolyPluginPlayerController— controller setup and tool spawningFloorPlacementControllerComponent— input routingBP_ExampleRuntimeFloorPolygonToolActor— placement toolBP_BoundaryActor— how walls become a node networkBP_FloorPolygonRenderer— how polygons become visible meshes
Example 2 — Place a single floor tile
Minimal code path for placing one rectangular tile at the cursor position.
What happens:
- Send an
FFloorInputEventwithKind = ClickPointandApplyMode = CommittoUFloorInputService. UClickPointResponsibilityHandleradds the tile polygon toUPolygonDatabase.UFloorPolygonChangeServicenotifiesIFloorPolygonChangeListenerobjects.BP_FloorPolygonRendererrebuilds the mesh section for that material.
Blueprint outline:
Get Game Instance Subsystem (DynamicFloorPluginSubsystem) → Get Floor Input Service → Handle Input Event Kind: ClickPoint Position: (cursor world position) MaterialId: 1 FloorType: Default ApplyMode: CommitExample 3 — Room fill placement
Fill an entire room area defined by its walls.
Prerequisites:
- A
BP_BoundaryActor(or equivalent) has created a closed node network representing your room walls.
What happens:
- Send
FFloorInputEventwithKind = Filland the cursor position inside the room. UFillEventResponsibilityHandlercallsUNodeNetworkSubsystem.getNodeNetworkEnclosingPositionto find the enclosing network.- The enclosed polygon is computed and added to
UPolygonDatabase. - Renderers are notified.
Node network setup (in a BoundaryActor or wall actor):
Get World Subsystem (NodeNetworkSubsystem)
For each wall endpoint / junction: → getOrCreateNodeAtPosition(position, NodeClass, NodeType=1, NodeMaterial=0)
For each pair of connected nodes: → NodeA.ConnectNode(NodeB)The fill function will automatically detect the enclosed polygon once all wall nodes are connected.
Example 4 — Custom tool shape (triangle)
The default tool uses a rectangle. Here is how to use a triangle instead.
-
Create a Blueprint subclass of
BP_ExampleRuntimeFloorPolygonToolActor. Name it e.g.BP_TriangleFloorTool. -
Override
Event BeginPlayin your subclass. -
In BeginPlay, set the
ToolShapevariable to your triangle:ToolShape = [(Vector: 0, 0, 0),(Vector: 100, 0, 0),(Vector: 50, 100, 0)](Adjust coordinates to match your desired triangle size and orientation.)
-
Call the parent BeginPlay first (or after, as appropriate).
-
Use
BP_TriangleFloorToolwherever you previously usedBP_ExampleRuntimeFloorPolygonToolActor.
The rest of the tool pipeline (hit detection, preview, commit) works identically.
Example 5 — Custom HUD with floor selector
Build your own HUD that lets the player pick a floor material and trigger placement.
HUD setup:
- Create a new Widget Blueprint for your HUD.
- Add a Place Floor button (or a material selector + place button).
- On button click:
Get Player Controller→ Call PlaceFloor(FloorType=Default, FloorMaterial=<selected material ID>)
- Make sure your Player Controller implements
UiToControllerInterfaceand handles thePlaceFloorevent by spawning a tool and callingSetActiveTool.
The example HUD is at DynamicFloorPlugin/Blueprints/ExampleGameplay/HUD — use it as a reference.
Example 6 — Polygon union (merging floor areas)
Merge several separate floor polygons into one unified shape using UFloorPolygonClipperLibrary.
Blueprint outline:
Get Polygon Database → GetPolygons → filter the polygons you want to merge
UFloorPolygonClipperLibrary → UnionPolygons( InputPolygons: [polygonA, polygonB, polygonC], Height: 0.0, MaterialId: 1, FloorType: Default)→ Result: TArray<FFloorPolygon> (merged output)
For each result polygon: → Get Polygon Database → InsertPolygonWithMaterialHandling(...)Use DifferencePolygons for the opposite operation — cutting a shape out of existing polygons (e.g. removing a doorway from a floor).
Example 7 — Save and load floors
Persist the floor state between play sessions.
Save
Create Object of Class: UPolygonDatabaseSaveManager → SaveNodeSystem()
Create Object of Class: UNodeSystemDefaultSaveManager → SaveNodeSystem()Load
Create Object of Class: UPolygonDatabaseSaveManager → LoadNodeSystem()
Create Object of Class: UNodeSystemDefaultSaveManager → LoadNodeSystem()Save slots
| Manager | Slot name |
|---|---|
UPolygonDatabaseSaveManager | PolygonDatabaseSaveSlot |
UNodeSystemDefaultSaveManager | NodeSystemSaveSlot |