Stair Path Generator
With the Spline Stair Path Generator you draw a spline, and PolyBash builds a walkable corridor along it. Sections that rise become stairs, and sections that stay level become a flat path. The generator also adds side walls, openings with tunnels, edge trims, railings and colliders.
This page documents every section of the inspector. The page Spline Generators Overview explains the parts that both generators share, such as the build cycle, the stage system and the Info section.
How the spline becomes stairs and a path
The spline knots divide the corridor into sections, and one section spans the distance between two knots. The generator classifies each section with the fields of the Shape section.
| Condition | Result |
|---|---|
| The height difference is smaller than Min Step Height. | Flat path. |
| The slope is below Min Step Height divided by Max Step Depth. | Flat path. |
| The slope is above Max Step Height divided by Min Step Depth. | Too steep. The generator builds a flat path, and it reports the section in the Info section. |
| The slope lies between those two limits. | Stairs. |
A stair section receives the smallest step count that respects both limits. The generator divides the height by Max Step Height, divides the length by Max Step Depth, and then uses the larger of the two results. The step size that results from that count is rarely exactly your minimum or your maximum. The count keeps each step at or below Max Step Height, and it keeps the mean step depth at or below Max Step Depth. A step can be lower than Min Step Height or shallower than Min Step Depth. The generator compares the step height and the mean step depth of each section with the limits and their tolerance. It reports each breach as a warning in the Info section. A message names the section, the value and the accepted range. The message counts the sections from 0, so "Section 0" is the node Section-01.
A flat section receives the smallest piece count for which no piece is longer than Max Path Depth. A larger value lowers the polygon count of the path, and a curve becomes coarser. To keep the texture scale while you change that value, set Path Uv Mode to Arc Length.
To convert a section from a path into stairs, raise or lower one of its two knots. To convert stairs into a path, level the two knots.
Quick start
- Create the generator, as Add a generator to a scene describes.
- Draw a spline with at least three knots, and raise the middle knot.
- Assign a material to Default Material.
- In the Shape section, adjust the step limits, and edit the corridor widths in the Per-Knot Offsets foldout.
- In the Walls section, select Add Walls.
- In the Railings section, select a Side.
After a change outside the inspector, such as an edit of a material, select Regenerate.
Pieces
The generator builds its own meshes, and it needs no further asset. The Pieces section holds every parameter of those meshes.
PolyBash generates a set of template pieces from these parameters, and each template carries a deformation lattice. During the build, the lattice deforms each template along the corridor, so one template adapts to every step size, corridor width and curve. The parameters describe only the template, and the real size of a step comes from the spline and from the Shape section. The build only moves and rotates the balusters and the newels, so they keep the size of their parameters.
Include groups
| Toggle | Default | Content |
|---|---|---|
| Include Stairs | On | The step bodies and their sidewalls. |
| Include Path | On | The flat path segments. |
| Include Edges | On | The edge prisms along the step and path boundaries, plus their end caps. |
| Include Rails | On | The handrail prisms, which sit above the edges. |
| Include Posts | On | The balusters and the newels. |
| Include Arch Frame | On | The blocks of the arch frame around a tunnel opening. |
Edges and rails need the stair pieces and the path pieces as a reference for their offset. As a result, PolyBash includes both groups automatically, and a note reports that behavior. The parameter groups appear only for the groups that you include, with two exceptions. Core — Stairs & Path always appears, and Edges also appears while Include Rails is selected.
Core — Stairs & Path
| Field | Default | Description |
|---|---|---|
| Num Steps | 16 | The number of step pieces in the set. The V range of the texture divides across that number, so a chain of that many steps shows the texture once. |
| Rise | 0.15625 | The height of one template step, in meters. |
| Tread | 0.3125 | The depth of one template step, in meters. |
| Width | 5 | The width of every template piece, in meters. It also divides the UV, so a value above 0 is mandatory. |
| Chamfer | 0.05 | The size of the bevel at the step nose, in meters. A value of 0 produces a sharp corner. |
| Soft Step Edges | On | Welds the normals at the step nose, so that the nose looks round. |
| Num Path Segs | 16 | The number of path pieces in the set. It divides the texture like Num Steps. |
| Path Grid Subdivisions | 4 | The number of grid cells across and along each path piece. The deformation bends a path piece into a trapezoid on a curve, and a piece with one cell then warps its texture along the diagonal. More cells keep the texture straight and cost more triangles. A value of 0 uses the default of 4. |
The UVs foldout holds Uv U Min, Uv U Max, Uv V Min, Uv V Max and Uv Pad. These fields select the region of the texture that the step bodies use. The path pieces use only Uv U Min, Uv U Max and Uv Pad. Their V coordinate spans 0 to 1 over the whole set of path pieces. Uv Pad removes a border inside that region, so that the pieces never sample outside it.
Edges
| Field | Default | Description |
|---|---|---|
| Edge Width | 0.32 | The width of the edge prism, in meters. |
| Edge Height | 0.38 | The height of the edge prism, in meters. Use a value above Rise, because a value equal to Rise or lower degenerates the lattice, and the edge then ignores the slope. |
| Edge Cap Length | 0.2 | The length of the cap piece that closes an open end, in meters. |
Rails
| Field | Default | Description |
|---|---|---|
| Rail Width | 0.24 | The width of the handrail, in meters. |
| Rail Height | 0.3 | The height of the handrail, in meters. Use a value above Rise. |
| Rail Post Height | 1.1 | The height of the handrail bottom above the bottom of the edge, in meters. The same value sets the height of a baluster. |
Posts
| Field | Default | Description |
|---|---|---|
| Rail Post Thickness | 0.16 | The thickness of one baluster, in meters. |
| Rail Post Side Count | 6 | The number of sides of the baluster prism. The smallest value is 3. |
| Rail Post Height | 1.1 | The height of one baluster, in meters. This field appears here when Include Rails is off. |
| Newel Thickness | 0.28 | The thickness of one newel, in meters. |
| Newel Height | 1.4 | The height of one newel, in meters. |
| Newel Side Count | 4 | The number of sides of the newel prism. The smallest value is 3. |
Arch Frame
| Field | Default | Description |
|---|---|---|
| Num Arch Frame Blocks | 16 | The number of different blocks in the set. The chain around an opening repeats them. |
| Arch Frame Width | 0.24 | The width of one block, in meters. |
| Arch Frame Depth | 0.12 | The depth of one block, in meters. |
| Arch Frame Height | 0.12 | The target length of one block along the outline of the opening, in meters. A smaller value adds blocks to the chain. |
| Arch Frame Uv Scale | 0.2 | The texture scale around the profile of a block, in the U direction. The blocks of one cycle always span V 0 to 1. |
Validation
The section reports every problem below the fields. An error blocks the build, and a warning describes a result that is probably unwanted. The most frequent messages concern a value of 0 or a side count below 3. A warning also appears when Edge Height or Rail Height is equal to Rise or lower.
A configuration without any group produces the warning "No piece groups enabled — nothing to generate", and the build stops.
Materials
| Field | Description |
|---|---|
| Stair Material | The material of the step bodies. |
| Path Material | The material of the flat path segments. |
| Stair Hard Edges | Splits the normals of the stair meshes at each face boundary. |
| Path Hard Edges | Splits the normals of the path meshes at each face boundary. |
An empty material field falls back to Default Material, at the top of the inspector.
While Add Walls is selected, the sidewalls of the steps use Wall Material, and their texture continues the texture of the wall.
Shape
Step
| Field | Default | Description |
|---|---|---|
| Min Step Height | 0.1 | The lower limit for the height of one step, in meters. It also decides between a path and stairs. A lower step produces a warning in the Info section. |
| Max Step Height | 0.22 | The largest height of one step, in meters. It drives the step count. |
| Min Step Depth | 0.2 | The lower limit for the depth of one step, in meters. A shallower step produces a warning in the Info section. |
| Max Step Depth | 0.4 | The largest depth of one step, in meters. It drives the step count. |
| Step Height Tolerance | 0.1 | The accepted deviation from the height limits, as a fraction. A value of 0.1 accepts 10 percent above and below. |
| Step Depth Tolerance | 0.1 | The accepted deviation from the depth limits, as a fraction. |
| Constant Slope | Off | Distributes the steps of one section with a uniform depth and a uniform rise. With this option off, the generator subdivides at uniform height increments. |
When the steps of one section differ in depth, select Constant Slope. Such steps appear, for example, on a spline that curves up and down between two knots.
Path
| Field | Default | Description |
|---|---|---|
| Max Path Depth | 0.4 | The largest length of one path piece, in meters. A larger value builds fewer and longer pieces, so the polygon count drops and a curve becomes coarser. |
| Path Vertical Anchor | 0 | The position of the piece against the spline. A value of 0 places the bottom of the piece on the spline, and a value of 1 places the top on it. The procedural path pieces are flat, so this field has no effect on them. |
| Path Uv Mode | Per Piece | How the texture follows the length of a piece. Per Piece keeps the authored UVs of every piece, so a longer piece stretches the texture. Arc Length lets the V coordinate follow the distance along the spline, so the texture keeps its scale for any Max Path Depth. The V coordinate continues from one path section into the next. Edge pieces on a path follow the same mode. |
| Path Uv Repeat Length | 0 | The distance along the spline, in meters, that one repeat of the texture covers in Arc Length mode. A value of 0 uses the authored depth of the whole piece cycle, which is 5 meters for the default procedural pieces. |
Dimension
| Field | Default | Description |
|---|---|---|
| Left Offset | 2.5 | The half-width on the left of the spline that a new knot receives, in meters. |
| Right Offset | 2.5 | The half-width on the right of the spline that a new knot receives, in meters. |
The foldout Per-Knot Offsets holds one Left value and one Right value per knot, and the build uses only these values. A knot that you add at the end of the spline receives the two values above. Reset All To Global restores those values at every knot. Each value belongs to a knot index, so an insert or a deletion inside the spline shifts the widths of the knots after it. After such a change, verify the widths of the following knots. You can also drag the cyan handles in the Scene view to edit the same values. Hold Shift to move both sides at the same time.
Walls
A wall stands on each side of the corridor. Its top follows the corridor surface, and its bottom sits at the wall floor of each knot.
| Field | Default | Description |
|---|---|---|
| Add Walls | Off | Builds the side walls. Every other field of this section needs this option. |
| Wall UV Scale | 5 | The size of the texture on the wall, in meters. |
| Wall Hard Edges | On | Splits the normals of the wall mesh at each face boundary. |
| Add Wall Colliders | Off | Adds one mesh collider to the Walls node of each section. It reuses the rendered wall, with the openings already cut. |
| Add Tunnel Colliders | Off | Adds one mesh collider to the Tunnel node of each section. |
| Wall Collider Thickness | 0.1 | The inward extrusion of the wall collider and the tunnel collider, in meters, so that the collider has a volume. A value of 0 reuses the surface. |
| Segments Per Collider | 1 | The number of wall segments that one collider segment spans. A value of 1 matches the rendered wall, and a higher value produces a coarser collider. |
| Tunnel Segments Per Collider | 1 | The same coarsening for the ceiling of a tunnel. |
| Wall Material | — | The material of the walls. An empty field falls back to Default Material. |
| Section Wall Left | — | One override per section for the left wall. |
| Section Wall Right | — | One override per section for the right wall. |
An override accepts three values. None and On build the wall while Add Walls is selected, and Off removes it. Use Off to open one side of the corridor toward a room.
Per-Knot Base Offsets
This foldout holds the depth of the wall floor below each knot, in meters. A value of 0 places the floor at the knot itself, so the wall has no height there.
The first build sets each depth so that every floor sits at the height of the lowest knot. As a result, the lowest knot starts with a depth of 0. A knot that you add at the end of the spline receives the depth that puts its floor at the current lowest floor. When you move a knot, its depth stays the same, and its floor moves with the knot.
While Add Walls is selected, an orange handle sits below each knot in the Scene view. The toggle Wall-Floor Base Handles in the Scene Gizmos section controls these handles. Drag the handle up or down to change the depth of that knot.
| Button | Result |
|---|---|
| Reset All To Zero | The floor of each knot sits at the height of that knot. |
| Reset All To Lowest Knot | Every floor moves to the height of the lowest knot. |
| Reset All To Lowest Floor | Every floor moves to the current lowest floor. |
Select Reset All To Lowest Knot for a corridor that must stand on flat ground.
Because each depth belongs to a knot index, select a reset button after you insert or delete a knot inside the spline.
Wall Openings
The foldout Wall Openings holds one card per opening. Add Opening appends a card, and Remove deletes one.
| Field | Default | Description |
|---|---|---|
| T | 0.5 | The position along the spline, from 0 to 1. |
| Width (m) | 1.5 | The width of the opening, in meters. |
| Height (m) | 2 | The height of the opening above the wall floor, in meters. |
| Corner Radius | 0.4 | The radius of the two upper corners, in meters. A value of 0 produces a rectangle. |
| Subdivide Factor | 1.5 | A wall edge inside the opening splits into shorter pieces when it is longer than this factor times the shortest edge there. A higher value produces fewer cuts, and the field has no effect while Max Subdivide Cuts is 0. |
| Max Subdivide Cuts | 0 | The largest number of extra cuts in one wall edge. A value of 0 disables the extra subdivision. |
| Add Tunnel | Off | Builds a passage under the corridor, from the left wall to the right wall. The passage needs both walls at the opening. |
| Frame Side | None | The side that receives an arch frame: None, Left, Right or Both. |
| Frame Depth | 0 | The depth of the frame blocks, in meters. A value of 0 uses the depth of the piece. |
| Frame Offset | 0.005 | The outward shift of the frame from the wall face, in meters, against z-fighting. |
The three frame fields need Add Tunnel, because a frame surrounds the entrance of a tunnel.
Two fields below the cards apply to every opening:
- Opening Min Clearance — the smallest vertical gap between the ceiling of an opening and the top of the wall, in meters. The default value is 0.1, and it prevents an opening that cuts through the upper edge of the wall.
- Arch Frame Material — the material of the frame blocks. An empty field falls back to Default Material.
The toggle Wall Opening Handles in the Scene Gizmos section controls the handles of the openings in the Scene view. The handles appear while Add Walls is selected.
- Drag the sphere on the spline along the corridor to change T.
- Drag one of the two cubes along the spline to change Width (m). The width grows on both sides, so the center of the opening stays in place.
- Drag the cube above the sphere up or down to change Height (m).
- The label above each opening shows its index, its width and its height.
Colliders & Physics
| Field | Default | Description |
|---|---|---|
| Add Colliders | On | Adds a mesh collider to the steps, the path, the edge trims, the rail posts and the arch frames. The walls, the tunnels and the ramp have their own options. |
| Physics Material | — | The physics material of every generated collider. The Ramp foldout can override it for the slab. This field needs Unity 6 or newer, because Unity renamed that class. |
The Ramp foldout replaces the stepped collider with a smooth slab, so a character slides along the staircase instead of stopping at each step.
| Field | Default | Description |
|---|---|---|
| Add Ramp Colliders | Off | Builds one invisible slab per stair section. |
| Add Path Colliders | Off | Builds the same slab over each path section. |
| Ramp Height | 0.5 | The height of the slab inside one rise. A value of 0 follows the lower tread, and a value of 1 follows the nosing. |
| Ramp Thickness | 0.15 | The downward thickness of the slab, in meters. |
| Bottom Wedge | Off | Extends the bottom of the ramp into a wedge, so that a body rolls onto the staircase without an edge at the bottom. |
| Steps Per Ramp | 1 | The number of steps that one slab segment spans. A higher value produces a coarser slab. |
| Physics Material | — | The physics material of the ramp. An empty field falls back to the field above. This field needs Unity 6 or newer. |
Stair Edges
This stage lays trim pieces along the boundaries of the corridor, and it produces nothing until an entry has a category. The foldout Edge Entries holds one card per entry, and each card title carries the index of the entry. Add Edge appends a card, and Remove deletes one.
| Field | Default | Description |
|---|---|---|
| Category | (None) | The piece category of this entry. DefaultTrim places the edge trim, and Handrails places the rail above the steps. (None) disables the entry. |
| Side | Both | The side that receives the trim: None, Left, Right or Both. |
| Material | — | The material of this entry. An empty field falls back to Default Material. |
| End Pieces | On | Closes the two open ends with the cap pieces of the category. |
After you add a card, select a Category, because a new card starts at (None).
A category that the pieces do not offer shows the suffix "(not in catalog)", and that entry produces nothing. For example, Handrails shows that suffix after you clear Include Rails.
Four fields below the entries apply to every entry:
| Field | Default | Description |
|---|---|---|
| Edge Hard Edges | On | Splits the normals of the trim at each face boundary. |
| Edge Weld Angle | 60 | The largest angle between two normals that still welds smooth. This field needs Edge Hard Edges off. |
| Add Edge Colliders | Off | Adds one solid collider prism per trim. |
| Segments Per Collider | 1 | The number of trim segments that one collider facet spans. |
For the usual result, add two entries: one entry with DefaultTrim for the trim at the foot, and one entry with Handrails for the rail.
Railings
This stage places the vertical posts: the balusters along the corridor, and the newels at the two ends of each staircase. While Side is None, only the sections with an override On receive posts.
| Field | Default | Description |
|---|---|---|
| Side | None | The side that receives balusters and newels: None, Left, Right or Both. |
| Baluster Skip | 3 | The number of steps between two balusters on a stair section. A value of 3 places one baluster every fourth step. A path section uses Path Baluster Spacing instead, unless that value is 0. |
| Path Baluster Spacing | 1.6 | The distance between two balusters on a path section, in meters, measured along the spline. The value does not depend on Max Path Depth. The balusters are centered on the section, and the cadence continues across consecutive path sections. A value of 0 places one baluster per path piece with Baluster Skip. |
| Baluster Lateral Offset | 0 | The outward shift of every baluster, in meters. |
| Baluster Vertical Offset | 0.25 | The vertical shift of every baluster, in meters. |
| Newel Lateral Offset | 0 | The outward shift of every newel, in meters. |
| Newel Vertical Offset | 0.1 | The vertical shift of every newel, in meters. |
| Newel On Path End | Off | Places a newel at a spline end that a flat path occupies. |
| Post Hard Edges | On | Splits the normals of the posts at each face boundary. |
| Baluster Material | — | The material of the balusters. |
| Newel Material | — | The material of the newels. |
The foldout Per-Section Post Overrides holds two rows per section: one row for the balusters, and one row for the newels. Each row overrides the left side and the right side. None follows Side, On forces the posts, and Off removes them.
Generated output
The generator creates one node per section, such as Section-01, and the names of the meshes describe their content.
| Node | Content |
|---|---|
Stairs |
The merged steps of that section. |
Paths |
The merged flat pieces of that section. |
Walls |
The left wall and the right wall, with the openings cut. When both side walls exist, the node of the first and the last section also holds the end wall that closes the corridor. |
Tunnel |
The ceiling and the caps behind an opening with Add Tunnel. |
Ramp |
The invisible collider slab, when the section has no Stairs or Paths node. Otherwise the slab becomes the collider of that node. |
ArchFrame_0_L |
The arch frame of opening 0, on the left side. |
Two stages emit their own roots, and each node below them carries the number of its section as a suffix:
Edgesholds one node per entry and section, such asEdge_0-00for entry 0.Railingsholds up to oneBalustersnode and oneNewelsnode per section, such asBalusters-00andNewels-00.
The suffix counts from 00, but the section nodes count from 01, so Balusters-00 belongs to Section-01.
Troubleshooting
| Problem | Cause and solution |
|---|---|
| A section stays flat although the knots differ in height. | The height difference is below Min Step Height, or the slope is below the smallest stair slope. Raise the knot, or lower Min Step Height. |
| A steep section becomes a flat path, and Info reports "too steep (slope past stair band)". | The slope exceeds Max Step Height divided by Min Step Depth. Move the knots apart, or raise Max Step Height. |
| Info reports a step height or a step depth outside its range. | The section divides into steps that miss your limits. Move the knots, or raise Step Height Tolerance or Step Depth Tolerance. |
| The steps are lower than Min Step Height. | The section is long for its height, so Max Step Depth sets the step count, and each step becomes lower. Raise Max Step Depth, or increase the height difference between the two knots. |
| The build stops, and Info reports piece errors. | A piece parameter is invalid. Read the messages in the Pieces section. |
| The walls are missing. | Add Walls is off, or the section override is Off. Select Add Walls, or set the override to None. |
| A wall has no height. | The depth of that knot is 0, for example at the lowest knot, which keeps a depth of 0 after you raise it. Enter a depth for that knot in Per-Knot Base Offsets, or drag its orange handle in the Scene view. |
| An opening produces no passage. | Add Tunnel is off, or the override of one wall in that section is Off. Select Add Tunnel, and set both wall overrides of that section to None. |
| An arch frame is missing. | Frame Side is None, or Add Tunnel is off, or Include Arch Frame is off. Set Frame Side to a side, and select Add Tunnel and Include Arch Frame. |
| The edges ignore the slope of the stairs. | Edge Height is equal to Rise or lower, so the lattice degenerates. Raise Edge Height. |
| The posts are missing. | Side is None in the Railings section, or Include Posts is off. Select a side, and select Include Posts. |
| A character stops at each step. | The stepped collider blocks the character. In the Ramp foldout, select Add Ramp Colliders. |