Doors and Windows — Wall Plugin
Doors and Windows
The CodPassionWall plugin uses a system called reveals to cut openings into walls. A reveal is an actor that defines both the visual mesh (door frame, window frame, etc.) and the hole shape that gets cut into the wall surface.
What is a Reveal?
A reveal is a Blueprint actor (child of ARevealBase) that:
- Has a mesh component (the visible door or window frame)
- Contains a hole-mask texture that defines the shape of the opening
- Registers itself on a target wall, which then cuts the hole automatically
The plugin ships with two example reveals:
Window_BP— a window frame with a rectangular openingDoor_BP— a door frame with a door-shaped opening
You can also create reveal shapes of any form — circular, arched, triangular, or custom.
Adding a window or door in the editor
- In the Place Actors panel, search for
Window_BP(orDoor_BP).
- Drag it onto the wall where you want it.
- Select the wall actor in the viewport.
- In the Details panel, go to WallPlugin | Wall | Reveals.
- Click + to add an entry to the
reveal_refsarray. - Click the eyedropper (Pick Actor from Scene) and click the reveal actor in the viewport.
The hole is cut immediately. You can drag the reveal along the wall and the hole updates automatically.
To remove a reveal, delete the entry from the reveal_refs array and call
Redraw Holes For Registered Components on the wall (or reconstruct the wall).
Adding a reveal at runtime (Blueprint)
-
Spawn the reveal actor (e.g.
Window_BP) at an arbitrary location, set it invisible. -
Perform a multi-line trace through the cursor toward the wall.
-
Call
Setup Yourselfon the reveal, passing the multi-hit array:RevealActor -> Setup YourselfMulti Hit Result: (results from multi-trace hitting the wall)The reveal calculates its position and orientation from the first hit result that lands on a wall.
-
Make the reveal visible.
-
Call
Register Revealon the wall, passing the reveal:WallActor -> Register RevealReveal: RevealActorAlternatively, call
Register Revealon the reveal actor itself (it registers itself with its registered wall).
To move a reveal from one wall to another at runtime:
- Call
Un Register Revealon the old wall. - Call
Setup Yourselfwith the new wall’s hit result. - Call
Register Revealon the new wall.
Refer to PluginExampleController_BP in the example map for a working demonstration —
the demo allows clicking a reveal and dragging it to a new wall.
Creating a custom reveal shape
To create a reveal with a custom opening (e.g. circular, arched):
1. Create a Blueprint child of ARevealBase
In the Content Browser:
- Right-click → Blueprint Class
- Parent class:
ARevealBase - Name it, e.g.
MyArchReveal_BP
2. Add a mesh component
Add a Static Mesh Component or Skeletal Mesh Component for the visible frame (optional but recommended).
3. Override Draw Your Reveal Form
This is the most important step. DrawYourRevealForm is called by the wall to generate the hole.
In the Blueprint event graph, implement Draw Your Reveal Form:
- Canvas — draw to this canvas to define the hole shape
- Pos On Texture — the center position of the reveal on the wall texture in texture space
Rules for the hole texture:
- White pixels = transparent hole
- 1 pixel = 1 cm² on the wall surface
- Draw white shapes at and around
PosOnTextureto define the opening
4. Override Setup Yourself (optional)
Setup Yourself receives the multi-hit result array from a screen-space line trace.
The default behavior (from ARevealBase) positions the reveal at the wall center based on the first hit.
Override this if you need custom positioning logic.
5. Implement Get Collision Marker World Positions (optional)
Returns four world-space positions (left, right, top, bottom) that define the reveal’s collision bounding markers. Override this if your reveal has a non-rectangular shape.
Reveal functions reference
On IWallBpInterface (the wall)
| Function | Description |
|---|---|
Register Reveal (reveal) | Registers a reveal on this wall and redraws all holes. |
Un Register Reveal (reveal) | Removes a reveal and redraws all holes. |
Redraw Holes For Registered Components | Forces a full redraw of all registered reveals. |
On IRevealBpInterface (the reveal)
| Function | Description |
|---|---|
Register Reveal | Self-registers with the registered wall. |
Unregister Wall Interface | Detaches this reveal from its wall. |
Register Wall Interface (wall) | Sets the wall reference directly. |
Setup Yourself (multiHitResult) | Positions the reveal on the wall from a multi-trace hit result. |
Draw Your Reveal Form (canvas, posOnTexture) | Override in Blueprint. Draws the hole shape onto the wall texture. |
Get Registered Wall Interface | Returns the currently registered wall. |
Get Reveal Location | Returns the reveal’s world location. |
Set Rotation (quat) | Sets the reveal’s rotation. |
Collision note
Reveals cut a visual hole into the wall mesh texture, but they do not modify physics collision on the wall mesh directly.
Workarounds:
- For AI / NavMesh: Use NavMesh proxy volumes or let the wall contribute nav-mesh geometry only. AI can still be pathed correctly without a physical hole.
- For player passage (third-person): Place an additional narrow, non-colliding wall segment at the door opening to fill the passage. Alternatively, use a separate invisible collision primitive with an excluded channel.