> For the complete documentation index, see [llms.txt](https://polysphere-studio.gitbook.io/trash-city-pack/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://polysphere-studio.gitbook.io/trash-city-pack/methods-to-place-trash/using-trash-spawner-blueprint.md).

# Using Trash Spawner Blueprint

Trash Spawner Blueprint is a powerful tool for placing objects in the viewport using physics. This tool is a great way to add realism and variation to the environment by creating piles of trash.

Pro:&#x20;

* You can spawn fast multiple types of trash and create piles of trash.&#x20;
* It will look more natural and it has a variety of materials

Cons:&#x20;

* Being based on the collisions of each object, sometimes you'll have to make small adjustments to the position/rotation of the models.

<div align="left"><figure><img src="https://525590349-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpqQfrcCF8X8XsT1FYN1y%2Fuploads%2Fs9esrD1rYO0r4QDMPWZL%2FBlueprintPresentation.gif?alt=media&amp;token=b35beb2b-469b-4bd6-ae30-7d734b0d71e2" alt=""><figcaption></figcaption></figure></div>

## How to use the tool

<div align="left"><figure><img src="https://525590349-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpqQfrcCF8X8XsT1FYN1y%2Fuploads%2FPoYzXEl4KPx0f15BPnp8%2FTrashBlueprintGraph.jpg?alt=media&amp;token=9bec96fb-3397-428f-8dcd-257886f91c47" alt=""><figcaption></figcaption></figure></div>

1. Drag and drop the blueprint in the scene and place it above the ground.

<div align="left"><figure><img src="https://525590349-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpqQfrcCF8X8XsT1FYN1y%2Fuploads%2Ftrbv25om4jlAsBTGU3S6%2FDragAndDropBl.gif?alt=media&amp;token=142a11c0-52de-4d3a-a42a-51f6fcb08de3" alt=""><figcaption></figcaption></figure></div>

2. Set "Number Of Trash" and "Rate" and then Start Simulation (Shift + S) and wait until all the models are spawned.

<div align="left"><figure><img src="https://525590349-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpqQfrcCF8X8XsT1FYN1y%2Fuploads%2FWSB0c7RjpeX87rwYSDb3%2F2023-03-29_16h51_07.png?alt=media&amp;token=905ee217-1aad-4c89-a336-1f6108f2fc21" alt=""><figcaption></figcaption></figure></div>

<div align="left"><figure><img src="https://525590349-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpqQfrcCF8X8XsT1FYN1y%2Fuploads%2FjwgtJb5qNy2BlZpSjXdD%2FSimulation.gif?alt=media&amp;token=2aa33336-4df4-4b1e-958e-9da719ba1fbf" alt=""><figcaption></figcaption></figure></div>

3. After all the meshes are spawned, you should stop the simulation (press ESC) - The models will disappear but this is normal.

* (Optional) Check "Show Last Simulation" if you want to see the static meshes from the last simulation.

Then you can press the button "Extract Meshes" from the "Last Simulation" category to extract the static meshes in the scene.&#x20;

OR

If you want to restimulate, you should press the "Clear" button from the "Last Simulation" category and simulate again.

<figure><img src="https://525590349-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpqQfrcCF8X8XsT1FYN1y%2Fuploads%2FzGP2W4TleNJ0RiS7Axzn%2FStopSimulationAndExtract.gif?alt=media&amp;token=91907d87-85b0-432e-bcf4-f8f3272c9a4d" alt=""><figcaption></figcaption></figure>

After you extract the meshes, you can delete the blueprint.&#x20;

You can set the length and width of the spawn zone:

<div align="left"><figure><img src="https://525590349-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpqQfrcCF8X8XsT1FYN1y%2Fuploads%2FrmSqE69qOqIfYD1EEqOK%2F2023-03-29_20h54_16.png?alt=media&amp;token=f2e4ff83-a2ac-468e-8b97-39929030b8f1" alt=""><figcaption></figcaption></figure></div>

<div align="left"><figure><img src="https://525590349-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpqQfrcCF8X8XsT1FYN1y%2Fuploads%2Fe9vXGcy84bAc0gVgDI7n%2FDimensionsSpawnZone.gif?alt=media&amp;token=bf0d77e2-4864-4b55-b039-4eaa37fce767" alt=""><figcaption></figcaption></figure></div>

## Trash Setup

<div align="left"><figure><img src="https://525590349-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpqQfrcCF8X8XsT1FYN1y%2Fuploads%2FaMaNDjvheTL2ezK6CEfs%2F2023-04-03_16h48_06.png?alt=media&amp;token=95c323f1-feee-49ee-9429-c2f03aaefc9b" alt=""><figcaption></figcaption></figure></div>

You can change the "Trash Setup" array to set which models will be spawned and for each one, you can set the scale range and the spawn chance.

<div align="left"><figure><img src="https://525590349-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpqQfrcCF8X8XsT1FYN1y%2Fuploads%2FwknQHkk5xt5cUATixdhW%2F2023-04-03_16h48_34.png?alt=media&amp;token=2f66695d-e06e-41df-b249-217def427aeb" alt=""><figcaption></figcaption></figure></div>

You can also store Trash Setup in a data table and add it to the "Trash Setup Table". There are a few different Trash Setups Tables already in the project. You can find them in ".../Blueprints/DataTables":

<div align="left"><figure><img src="https://525590349-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpqQfrcCF8X8XsT1FYN1y%2Fuploads%2FPZzVMCWHpFAbdXdpkNPv%2F2023-04-03_17h11_30.png?alt=media&amp;token=408492dd-58a8-4f13-b121-cdd63b0bd522" alt=""><figcaption></figcaption></figure></div>

<div align="left"><figure><img src="https://525590349-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpqQfrcCF8X8XsT1FYN1y%2Fuploads%2FWggEaeRBuBzb55szSe6r%2FTablesTrashSetups.gif?alt=media&amp;token=55916f44-9d8a-4c11-9e4a-c670c1469622" alt=""><figcaption></figcaption></figure></div>
