My First Wall
This tutorial explains how to set up components for procedurally generating a brick wall.
For the finished tutorial, check the scene My First Wall in Samples.
Setup
Before starting the tutorial, it is recommended to open the Cozy Tools
overlay toolbar. You can open it by pressing the ` key and selecting Cozy Tools.
Note
For more information about the overlay toolbar, refer to the Unity Overlay Toolbar documentation.
Geometry
Cozy Renderer
First, you will need to create a Cozy Renderer
. This component is responsible for managing geometry and procedurally generating draw calls. It functions similarly to Unity's Canvas
component, where a Canvas
contains UI elements in its hierarchy, and a Cozy Renderer
contains points, splines, planes, and other builders.
To create a Cozy Renderer
, use the menu item or right-click in the Hierarchy
view:
Cozy Builder > Renderer.
Cozy Point
Next, create a Cozy Point
, a GameObject with the Cozy Point
component. This acts as a control point for splines.
Using the Cozy Tools
toolbar, click the Create Point button to generate a point. Create four points to form a spline in the next step.
Note
Points created via Cozy Tools
are automatically parented to the currently selected GameObject. Select your Cozy Renderer
before clicking Create Point.
Cozy Spline
To generate a Spline
, select the points and use the Cozy Tools
toolbar, clicking the Create Spline button.
Cozy Plane
Before creating a Plane
, you'll need an additional spline. Duplicate the existing spline and points (Ctrl + D
) and move them slightly upward.
Now, create a Plane
using the Cozy Tools
toolbar. Select both splines and click the Create Plane button.
Note
The order of selected splines matters when creating a Plane
. Select the lower spline first for consistency with other prefabs.
Bricks
This section explains how to generate tiles for your plane.
First, create a new GameObject with the Cozy Grid
component and make it a child of the Plane
GameObject. The Cozy Grid
splits the plane into an array of cells. However, it does not produce draw calls on its own—you'll need modifiers for visualization.
Note
While the same GameObject can contain both Cozy Plane
and Cozy Grid
, using separate GameObjects helps separate procedural generation logic from geometry and simplifies copying/pasting properties.
Modifiers
Modifiers enhance the Cozy Grid
by manipulating cells and creating visual output.
Important
Modifiers are applied in the order they appear on the GameObject. Ensure Cozy Draw
is the last component, with other modifiers listed before it.
Cozy Draw
Cozy Draw
generates draw calls for each cell. For prefabs, use Models/Brick/Brick
, which includes four variations.
Running Bond
Running Bond
rearranges cell widths to create a brick-like pattern and occasionally splits bricks.
Quoin
Quoin
adds bricks at the corners of the plane.
String Courses
Adds additional rows of quads at specific repeated heights. This detail was historically used to indicate flooring levels in walls.
Crenelles
Removes bricks at specific rows in a fixed pattern to create a medieval defensive wall look.
Cut and Mask
Allows you to cut into the wall for features like doors and windows. To set this up:
- Add a
Cozy Cut
component to theCozy Grid
GameObject. - Add a
Cozy Mask
component to sibling GameObjects.