# Objects Build Layer

## Objects Build Layer

With TileWorldCreator you can also place single objects / prefabs based on an assigned blueprint layer. To do this, simple add an ObjectsBuildLayer instead of a TilesBuildLayer.

<div align="left"><figure><img src="/files/rQYPhgVMMteq2xExfvN0" alt="" width="407"><figcaption></figcaption></figure></div>

## Settings

| Layer Name      | The layer name                                                                                                                                   |
| --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
| Prefab Objects  | The prefab objects which should be spawned. If you have more than one assigned, TWC will randomly choose between them based on the weight value. |
| Blueprint Layer | The assigned blueprint layer.                                                                                                                    |

## Object Orientation

If object orientation is enabled, TWC will try to rotate the object prefab towards the tiles of the assigned orientation layer. This can be useful for placing bridges or ramps.

| Orientation Layer | The orientation layer which should be used to orient the object to. |
| ----------------- | ------------------------------------------------------------------- |
| Y Rotation Offset | Additional y rotation offset.                                       |

## Mesh

Similar to the TileBuildLayer merging. Objects can also be merged into clusters based on the cluster cell size.

{% hint style="warning" %}
Please note that increasing the cluster cell size can reduce draw calls. However, if your map supports runtime editing, this may slow down generation, as any modification will **trigger regeneration of the affected cluster and its surrounding clusters.**
{% endhint %}

| Shadow casting mode            | The shadow casting mode from the mesh renderer. On / Off / Two Sided / Shadows Only                                                                                                                                                                                                                                                            |
| ------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Object Layer                   | Which object layer the cluster object should get                                                                                                                                                                                                                                                                                               |
| Rendering LayerMask            | Which rendering layer mask the cluster object should get.                                                                                                                                                                                                                                                                                      |
| Collider type                  | <p>You can select between two collider generation types:<br><strong>Mesh Collider</strong>: Adds a mesh collider with the generated (merged tile) mesh.<br><strong>Tile Collider</strong>: Adds a mesh collider with a simplified generated mesh based on <strong>Collider Height</strong> and <strong>Collider Extrusion Height</strong>.</p> |
| Tile Collider Height           | The height of the generated tile collider.                                                                                                                                                                                                                                                                                                     |
| Tile Collider Extrusion Height | The height of the extruded "walls" of the tile collider.                                                                                                                                                                                                                                                                                       |

## Offset

Additional layer offset.

## Randomization

Add additional rotation and scale randomization for each instantiated object.

| Uniform Scale          | If enabled, object will be randomly scaled uniformly across all axis.                                                                                                           |
| ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Min Scale              | The minium random scale value.                                                                                                                                                  |
| Max Scale              | The maximum random scale value.                                                                                                                                                 |
| Min Rotation           | The minimum random rotation value.                                                                                                                                              |
| Max Rotation           | The maximum random rotation value.                                                                                                                                              |
| Position Offset Radius | Objects are always placed at the center of a cell. To add variation, you can set a position offset radius, which will randomly offset the object’s position within that radius. |

## Child Objects

For each "main" object, additional child objects can be spawned.

| Child Prefab  | The child prefab to spawn.                                                      |
| ------------- | ------------------------------------------------------------------------------- |
| Count         | The amount of instances TWC should spawn.                                       |
| Radius        | The radius within the childs should spawn from the main object.                 |
| Uniform Scale | If enabled, the child object will be randomly scaled uniformly across all axes. |
| Min Scale     | The minium random scale value.                                                  |
| Max Scale     | The maximum random scale value.                                                 |
| Min Rotation  | The minium random rotation value.                                               |
| Max Rotation  | The maximum random rotation value.                                              |


---

# Agent Instructions: 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:

```
GET https://giantgrey.gitbook.io/tileworldcreator-v4-documentation/configuration/build-layers/objects-build-layer.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
