Skip to content

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 opening
  • Door_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

  1. In the Place Actors panel, search for Window_BP (or Door_BP).
  1. Drag it onto the wall where you want it.
  1. Select the wall actor in the viewport.
  2. In the Details panel, go to WallPlugin | Wall | Reveals.
  3. Click + to add an entry to the reveal_refs array.
  4. 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)

  1. Spawn the reveal actor (e.g. Window_BP) at an arbitrary location, set it invisible.

  2. Perform a multi-line trace through the cursor toward the wall.

  3. Call Setup Yourself on the reveal, passing the multi-hit array:

    RevealActor -> Setup Yourself
    Multi 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.

  4. Make the reveal visible.

  5. Call Register Reveal on the wall, passing the reveal:

    WallActor -> Register Reveal
    Reveal: RevealActor

    Alternatively, call Register Reveal on the reveal actor itself (it registers itself with its registered wall).

To move a reveal from one wall to another at runtime:

  1. Call Un Register Reveal on the old wall.
  2. Call Setup Yourself with the new wall’s hit result.
  3. Call Register Reveal on 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 PosOnTexture to 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)

FunctionDescription
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 ComponentsForces a full redraw of all registered reveals.

On IRevealBpInterface (the reveal)

FunctionDescription
Register RevealSelf-registers with the registered wall.
Unregister Wall InterfaceDetaches 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 InterfaceReturns the currently registered wall.
Get Reveal LocationReturns 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.