Share

In this tutorial, we’ll create a procedural building generator in Unreal Engine. By breaking down the process into simple steps, we’ll learn how to construct buildings using repeated meshes and apply this technique to various sides of the building.

What is procedural building in unreal engine 5?

Unreal Engine 5‘s procedural building approach involves the automated construction of structures based on predefined rules and parameters. This method allows for the generation of a wide array of buildings, from simple dwellings to intricate skyscrapers, each with its unique style and layout.

The Procedural Content Generation Framework (PCG) integrated into Unreal Engine 5 streamlines the implementation of procedural building techniques. Core elements of this framework encompass

Step 1: Window Mesh Creation

1. Design a single window piece that’s tileable both horizontally and vertically. Ensure the origin is at (0,0) and the bottom-left corner of the window.
2. Create a material for the window mesh that supports tiling.
3. Export the window mesh.
4. Ensure the export that in fbx briny
5. you can create a window in any software

 Window Mesh Creation
for procedural building in unreal engine 5

Step 2: Constructing Walls and Sides

1. Open Unreal Engine and create a new actor.
2. Use the Construction Script to build the procedural building.
3. Add an “Instant Static Mesh” component to spawn multiple meshes.
4. Connect this component to a “Set Static Mesh” node.
5. Create variables for width, depth, and height. These will define the building’s dimensions.
6. Use a “For Loop” for both the X and Y axes to calculate window positions.
7. Add an “Add Instance” node to place windows based on loop indices.
8. Adjust the positions using calculations for the X and Z coordinates.
9. Use the “Set World Location” node to place the windows accurately.
10. Duplicate and customize this code for different sides of the building (front, back, left, and right).

Constructing Walls and Sides
for procedural building in unreal engine 5

Step 3: Spawning the Roof

1. Design a tileable roof mesh and export it.
2. Create an “Instant Static Mesh” component for the roof in the blueprint.
3. Set up variables for width, height, and window width to customize the roof.
4. Use loops for X and Y axes to position roof elements.
5. Add the “Add Instance” node to position roof components based on loop indices.
6. Adjust positions using calculated X and Y coordinates.

Spawning the Roof
for procedural building in unreal engine 5

Final Result:
By following these steps, you’ll have a functional procedural building generator in Unreal Engine 5. This method enables you to easily customize and expand the building generation process, adding details, materials, and even randomization for more complex structures.

Conclusion:
This tutorial provides a simple yet powerful technique to create procedural buildings in Unreal Engine.5.

Watch more about it

SUGGESTED
Importing animated hair (x-gen) from Maya to Unreal
Assigning multiple characters to single character
Importing character from mixamo to unreal
How to create 3d animations?
A Beginner’s Guide to 3D Animation