> For the complete documentation index, see [llms.txt](https://quasistellar-game-development.gitbook.io/town-generator/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://quasistellar-game-development.gitbook.io/town-generator/reference/road.md).

# Road

The Road class is derived from the Building class and contains the same properties with the following additions.

## General

### Other Settings

#### Align To Terrain

If enabled will automatically position the Road's Spline knots on the terrain.

#### Attach Point Interval Distance

Attach Points are automatically generated along the Road Spline. This is the distance between each point.\
Default: 5

#### Attach Point Distance From Road

This is the distance from the edge of the road that the Attach Points are placed.\
Default: 2

#### Attach Point Max Height Difference

This value is set on the generated Attach Points as their Max Height Difference.\
Default: 1.5

#### Attach Points To Road Side

Select the side of the road on which to add Attach Points. None, Left, Right or Both\
Default: Both

### Create Mesh

#### Should Create Mesh

If enabled, the generated road mesh will be applied to a Mesh Renderer component.\
Default: on

#### Enable Mesh Collider

If enabled, the generated mesh will be applied to a Mesh Collider component and enabled in Play Mode.\
Default: off

#### Middle Point Height

The generated mesh can be given an incline towards the middle. Set how high it should be here. \
Default: 0.1

#### Mesh Texture Scale

Set the Texture scale to be applied to the generated mesh.\
Default: 10

#### Default Width

This is the default width of the road.\
Default: 2

#### Widths

The Road has a width tool. In order for it to work correctly this list needs a corresponding item for each Spline in the Spline Container. Each item in the list has a default width and can have multiple points for a different width value on the spline.\
Default: empty

## Terrain Manipulation

Same properties as on a Building except that Doors options have been removed for Roads.

## Path Painting

Same properties as on a Building.

## Functions

#### Button: Fix Object Pivot Point

This Helper function re-center's the object's pivot point. When drawing Spline knots the origin of the object never ends up being at it's center and in some cases we may need to have it fixed.

### Terrain Manipulation

Same functions as on the Building.

### Paint Terrain

Same function as on the Building.

## Debugging

Same properties as on the Building with the following additions.

#### Use Building Terrain Manipulation

Roads use a different Terrain Manipulation process from that of Buildings. Because we are deriving from a Building it is possible to run the Building's process instead.

#### Update In Progress

Indicates whether the Road is busy re-generating its mesh and attach points. Sometimes the process has not finished while Unity re-compiles and then the process ends up hanging. Use the Stop Prepare button to reset it.

#### Button: Stop Prepare

Stop the generation process. Sometimes the process has not finished while Unity re-compiles and then the process ends up hanging. Use the Stop Prepare button to reset it.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://quasistellar-game-development.gitbook.io/town-generator/reference/road.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
