> 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/tutorials/building-setup.md).

# Building Setup

### Tutorial

{% embed url="<https://www.youtube.com/watch?v=V0G6PN1w4HU>" %}

*PS: While this video tutorial is a bit out-dated, it is still relevant. See updated instructions below using the added quick buttons.*

1. Create a Prefab of your Building Model.
2. Add the Building Script to your Building Prefab.

   <figure><img src="/files/KXhDBMaTuvqRzpSYNrf9" alt=""><figcaption></figcaption></figure>
3. Make sure the building model is at the correct height using a 3D Plane. Position the Plane at zero and check that your building doors are at a good height relative to the Plane as if the Plane is the Terrain. Then Delete the Plane again.

   <figure><img src="/files/6TbSiQUYXFrYYbINWWuz" alt=""><figcaption></figcaption></figure>
4. Open the Functions tab of the Building Component:

   <figure><img src="/files/XAZsqgtBs9YRvt9GaCAi" alt=""><figcaption></figcaption></figure>
5. Click Door under the Create Other heading.
6. Position the Door prefab at the correct position of your Building model. Duplicate it for all the doors of your model. You may need to resize the Trigger Collider to fit the size of your doors.

   <figure><img src="/files/bkIoHBfpwV17feLY5vqf" alt=""><figcaption></figcaption></figure>
7. Next use the Create Attach Points section to easily add AttachPoints to your building.<br>

   <figure><img src="/files/xM595vZ1xN775win87w4" alt=""><figcaption></figcaption></figure>
8. Position the AttachPoints where you would like adjacent buildings to be generated. You can keep AttachPoints at zero height, or on the ground. All AttachPoints of the same Building-Set should be at the same height.

   <figure><img src="/files/BxMcCVyIonAQFidxZ5eY" alt=""><figcaption></figcaption></figure>
9. Duplicate the AttachPoint and add as many as you like.

   <figure><img src="/files/TU3VwXkEZYXrxyHowgUd" alt=""><figcaption></figcaption></figure>
10. Change the preferred Maximum Height Difference (the default is 1.0) for each AttachPoint on the AttachPoint Component.
11. Save your Prefab


---

# 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/tutorials/building-setup.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.
