Skip to content

Spawn a window at runtime

Spawn a draggable window from game logic instead of placing it in the designer hierarchy.

flowchart LR
  Btn[Settings button clicked] --> Create[Create Draggable Window]
  Create --> Add[Optional: Add Content Widget]
  Add --> VP[Add to viewport]
  1. On button On Clicked, call Create Draggable Window (Child Widget Class).
  2. Set Window Class to your WBP_DraggableWindow (or subclass).
  3. Set Child Widget Class to the panel you want inside the frame (e.g. settings UI).
  4. Tune Start Size (640×480 is a good default), Center To Screen = true.
  5. Add the returned widget to the viewport (or parent under your HUD root).
Use caseStart SizeCan ResizeStartup State
Modal dialog480×320falseDefault
Full app window960×640trueDefault
Tray-style launcher320×240trueStart Minimized

Bind On Close Window on your window subclass to play UI sound or refresh HUD state. Call Close Window from a title-bar close button.

// C++ equivalent (minimal)
UDraggableWindow* Window = UDraggableWindow::CreateDraggableWindow(
this, WindowClass, ChildClass, FVector2D(640.f, 480.f));
if (Window) { Window->AddToViewport(); }
IssueFix
Window does not dragEnable Drag = true; WindowTitleBorderWidget bound
Cannot resizeEnable Resizing = true; ResizeAreaWidget bound with Is Variable
Child emptyPass Child Widget Class or call Add Content Widget after create