# Creating Buildable Object SO Assets

Now that we have five Buildable Objects ready to use in our grid, the next step is to create **Buildable Object SO assets**. These assets store data that defines how the Buildable Object prefabs behave in the **Easy Grid Builder Pro 2** system.

As a reminder, there are four **Buildable Object Types**, and corresponding to those, there are four **Buildable Object SO types**. These are **scriptable objects** that hold data specific to the Buildable Objects.

#### Steps to Create a Buildable Object SO Asset

* Inside the **2D City Builder Tutorial Demo** folder, create a new folder and name it **Buildable Objects SO Assets**.
* Right-click inside the new folder and select: <mark style="color:purple;">**Create > SoulGames > Easy Grid Builder Pro 2 > Buildable Grid Object SO**</mark><mark style="color:purple;">.</mark> Rename the newly created asset to: **Buildable Grid Object SO - TopDown House 01**.

This process creates a **Buildable Grid Object SO** asset.

<figure><img src="https://2651556506-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FeumhICLT4oHoEIEssOjB%2Fuploads%2FLmfJQZ4hhPkl2klmLbJa%2Fimage.png?alt=media&#x26;token=996c26db-96e4-4e13-87b0-8eafd2ee6758" alt=""><figcaption></figcaption></figure>

As you can see, the **Buildable Object SO** asset includes many properties. In this guide, we’ll focus on the most essential ones needed to quickly set up our City Builder. For detailed information on all the features, refer to the following links:

* [**Buildable Grid Object SO**](https://soulgamess-studio.gitbook.io/easy-grid-builder-pro-2-documentation/scriptable-objects/buildable-grid-object-so)
* [**Buildable Edge Object SO**](https://soulgamess-studio.gitbook.io/easy-grid-builder-pro-2-documentation/scriptable-objects/buildable-edge-object-so)
* [**Buildable Corner Object SO**](https://soulgamess-studio.gitbook.io/easy-grid-builder-pro-2-documentation/scriptable-objects/buildable-corner-object-so)
* [**Buildable Free Object SO**](https://soulgamess-studio.gitbook.io/easy-grid-builder-pro-2-documentation/scriptable-objects/buildable-free-object-so)

#### Configuring the Buildable Grid Object SO

* **Set the Object Name**
  * Use the same name as the Buildable Object. For example: **TopDown House 01**.
* **Set the Object Icon**
  * For the **Object Icon** property, assign a sprite image to represent the Buildable Object in the UI.
  * Since we are using 2D sprites, we don’t need an additional icon. Simply use the **TopDown House 01 sprite** located in:\ <mark style="color:purple;">**2D City Builder Tutorial Demo > 2D Top Down Sprites**</mark><mark style="color:purple;">.</mark>

<figure><img src="https://2651556506-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FeumhICLT4oHoEIEssOjB%2Fuploads%2FcUTvkKheAHC8AeX9qY1t%2Fimage.png?alt=media&#x26;token=fbeb9041-fc9d-4c3b-97b6-d9b41bbb7195" alt=""><figcaption></figcaption></figure>

***

## <mark style="color:green;">Setting Up Buildable Object Category SO</mark>

Now, let’s set up the **Buildable Object Category SO** property for our **Buildable Grid Object SO - TopDown House 01** asset.

Inside the **Buildable Objects SO Assets** folder, right-click and select: <mark style="color:purple;">**Create > SoulGames > Easy Grid Builder Pro 2 > Buildable Grid Object Category SO**</mark><mark style="color:purple;">.</mark> Name the new asset: **Buildable Grid Object Category SO - TopDown Tutorial**.

Each **Buildable Object SO** asset requires a corresponding **Category SO** asset. Similar to the **Buildable Object SO** types, there are four **Buildable Object SO Category** types:

* [**Buildable Grid Object Category SO**](https://soulgamess-studio.gitbook.io/easy-grid-builder-pro-2-documentation/scriptable-objects/buildable-grid-object-so/buildable-grid-object-category-so)
* [**Buildable Edge Object Category SO**](https://soulgamess-studio.gitbook.io/easy-grid-builder-pro-2-documentation/scriptable-objects/buildable-edge-object-so/buildable-edge-object-category-so)
* [**Buildable Corner Object Category SO**](https://soulgamess-studio.gitbook.io/easy-grid-builder-pro-2-documentation/scriptable-objects/buildable-corner-object-so/buildable-corner-object-category-so)
* [**Buildable Free Object Category SO**](https://soulgamess-studio.gitbook.io/easy-grid-builder-pro-2-documentation/scriptable-objects/buildable-free-object-so/buildable-free-object-category-so)

It’s highly recommended to read more about these assets through the provided links.

**Category SO assets** allow layered placement of objects on grid cells. For example: A **Floor Buildable Grid Object** occupies 1 grid cell and has a category called **Modular Parts**. A **Bed Buildable Grid Object** also occupies 1 grid cell but has a category called **Furniture**. Since the two objects belong to different categories, they can occupy the same grid cell simultaneously.

In the **Buildable Grid Object SO - TopDown House 01** asset, assign the newly created **Buildable Grid Object Category SO - TopDown Tutorial** to the **Buildable Object Category SO** property.

This completes the setup for the **Buildable Object Category SO**. For this tutorial, we only need one category, so you can reuse this asset for other **Buildable Grid Object SO** assets.

<figure><img src="https://2651556506-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FeumhICLT4oHoEIEssOjB%2Fuploads%2FgfdOwo3ev7wsT2SnHoZq%2Fimage.png?alt=media&#x26;token=dd5c936a-c92a-4a6e-99ac-cb86d301415f" alt=""><figcaption></figcaption></figure>

***

## <mark style="color:green;">Setting Up Buildable Object UI Category SO</mark>

The **Buildable Object UI Category SO** property is used to categorize Buildable Objects in the **Easy Grid Builder Pro 2 UI**. To set it up:

* In the **Buildable Objects SO Assets** folder, right-click and select:\ <mark style="color:purple;">**Create > SoulGames > Easy Grid Builder Pro 2 > Buildable Object UI Category SO**</mark>. Name the new asset **Buildable Object UI Category SO - Houses**.
* Open the asset and set the following:

  * **Category Name**: Set it to **Houses**.
  * **Category Icon**: Use the **TopDown House 01** sprite from **2D City Builder Tutorial Demo > 2D Top Down Sprites**.

  Alternatively, you can assign any other icon that fits your needs.

This **UI Category SO** helps organize Buildable Objects into categories within the **Easy Grid Builder Pro 2 UI**, improving the clarity and usability of the interface.

<figure><img src="https://2651556506-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FeumhICLT4oHoEIEssOjB%2Fuploads%2FFVY7ELokwN7LRoMiQTVV%2Fimage.png?alt=media&#x26;token=e6445859-2bb3-48a1-9879-60f256f1d1ba" alt=""><figcaption></figcaption></figure>

Now, simply assign the newly created **Buildable Object UI Category SO - Houses** asset to the **Buildable Object UI Category SO** property in the **Buildable Grid Object SO - TopDown House 01** asset.

## <mark style="color:green;">Adding Buildable Objects To The SO Assets</mark>

Now, let’s configure the **Random Prefabs** property in the **Buildable Grid Object SO - TopDown House 01** asset. This property allows you to assign one or more Buildable Objects, setting the probability for selecting a random one when the object is placed on the grid. For this asset, we’ll use just one prefab.

#### Steps to Configure Random Prefabs

* Click the **+ icon** next to the **Random Prefabs** property to create a new element.
* In the new element, locate the **Object Prefab** property. Drag and drop the **TopDown House 01 Buildable Object prefab** from: <mark style="color:purple;">**2D City Builder Tutorial Demo > 2D Buildable Objects**</mark><mark style="color:purple;">.</mark>
* Locate the **Ghost Object Prefab** property. Drag and drop the same **TopDown House 01 prefab** here as well.\
  (Alternatively, you can assign a different prefab to use a unique ghost object for placement visualization. If you do this, the ghost object will be shown during placement, but the final object will be the prefab assigned to the **Object Prefab** property.)
* The **Probability** slider determines the likelihood of selecting this prefab if multiple prefabs are added. Since we’re only using one prefab, leave this value at **0**.

<figure><img src="https://2651556506-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FeumhICLT4oHoEIEssOjB%2Fuploads%2FUjfVWy7WCJPd3PgT4KES%2Fimage.png?alt=media&#x26;token=80d3f12d-0bb1-423f-8caa-7a9da8f510d1" alt=""><figcaption></figcaption></figure>

***

## <mark style="color:green;">Setting Up Object Placement Type</mark>

Finally, let’s configure the **Object Placement Type** property in the **Buildable Grid Object SO - TopDown House 01** asset.

Locate the **Object Placement Type** property. By default, it is set to **Single Placement**. Open the dropdown menu and select **Box Placement**.

This option allows the **TopDown House 01** object to be placed using the **Box Placement** method, ideal for creating multiple instances in a defined area.

For this tutorial, we’ll leave all other properties as default. This completes the configuration for the **Buildable Grid Object SO - TopDown House 01** asset.

<figure><img src="https://2651556506-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FeumhICLT4oHoEIEssOjB%2Fuploads%2F8bDQRBk1lg8JAgPXL5MT%2Fimage.png?alt=media&#x26;token=227b1649-559c-4c27-be3c-9425f6ad51b0" alt=""><figcaption></figcaption></figure>

***

## <mark style="color:green;">Repeating The Process For Others</mark>

To create two more **Buildable Grid Object SO** assets, follow these steps:

* Select the **Buildable Grid Object SO - TopDown House 01** asset.
* Press **Ctrl + D** to duplicate it twice, creating two new assets.
* Rename the second asset to **Buildable Grid Object SO - TopDown House 02**.

#### Configuring the Second Asset[^1]

* **Change the Object Name**
  * Open the **Buildable Grid Object SO - TopDown House 02** asset.
  * Set the **Object Name** property to **TopDown House 02**.
* **Update the Object Icon**
  * Replace the **Object Icon** property with the **TopDown House 02 sprite**, located in:\ <mark style="color:purple;">**2D City Builder Tutorial Demo > 2D Top Down Sprites**</mark>.
* **Modify the Random Prefabs Section**
  * In the **Random Prefabs** section, locate the first element.
  * Update the **Object Prefab** and **Ghost Object Prefab** properties with the **TopDown House 02 Buildable Object Prefab** from:\ <mark style="color:purple;">**2D City Builder Tutorial Demo > 2D Buildable Objects**</mark>.
* **Change the Object Placement Type**
  * Set the **Object Placement Type** property to **Single Placement**.

<figure><img src="https://2651556506-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FeumhICLT4oHoEIEssOjB%2Fuploads%2F6cx8XGrFEmOjrUo5vZen%2Fimage.png?alt=media&#x26;token=ee13b0d0-a360-4764-b183-4d984167f26f" alt=""><figcaption></figcaption></figure>

Follow these steps to configure the **Buildable Grid Object SO - TopDown House 03** asset:

* **Rename the Object Name**
  * Open the **Buildable Grid Object SO - TopDown House 03** asset.
  * Set the **Object Name** property to **TopDown House 03**.
* **Update the Object Icon**
  * Replace the **Object Icon** property with the **TopDown House 03 sprite**, located in:\ <mark style="color:purple;">**2D City Builder Tutorial Demo > 2D Top Down Sprites**</mark><mark style="color:purple;">.</mark>
* **Modify the Random Prefabs Section**
  * In the **Random Prefabs** section, locate the first element.
  * Replace the **Object Prefab** and **Ghost Object Prefab** properties with the **TopDown House 03 Buildable Grid Object Prefab** from:\ <mark style="color:purple;">**2D City Builder Tutorial Demo > 2D Buildable Objects**</mark><mark style="color:purple;">.</mark>
* **Set the Object Placement Type**
  * Change the **Object Placement Type** property to **Paint Placement**.

<figure><img src="https://2651556506-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FeumhICLT4oHoEIEssOjB%2Fuploads%2FEIlcD5nXBtYjJe1wJ2ym%2Fimage.png?alt=media&#x26;token=b0ce8827-fe86-462a-916c-6ddf68d15056" alt=""><figcaption></figcaption></figure>

{% hint style="warning" %}
As you know, our smallest **Buildable Grid Object** is **TopDown House 01**. However, as we saw earlier, it occupies **2 x 2 grid cells** when placed because our **Grid Cell Size** is set to **1**.

When using any **Box Placement Types** (e.g., **Box Placement**, **Wire Box Placement**, **Four Directional Wire Placement**, or **L-Shaped Placement**), it is recommended to use objects that occupy only **1 x 1 grid cells** (one cell) for optimal functionality.

For example, **TopDown House 01** would occupy only **1 cell** if we increased the **Grid Cell Size** to **2**. However, for this guide, we will keep the **Grid Cell Size** at **1** and proceed accordingly.
{% endhint %}

***

## <mark style="color:green;">Creating Buildable Free Object SO Assets</mark>

Now let’s create a **Buildable Free Object SO** asset for the trees:

* **Create a New Buildable Free Object SO Asset**
  * Inside the **Buildable Objects SO Assets** folder, right-click and select:\ <mark style="color:purple;">**Create > SoulGames > Easy Grid Builder Pro 2 > Buildable Free Object S**</mark>**O**.
  * Rename the new asset to **Buildable Free Object SO - TopDown Tree**.
* **Configure the Asset**
  * Set the **Object Name** property to **TopDown Tree**.
  * For the **Object Icon**, assign the **TopDown Tree 01 sprite** located in:\ <mark style="color:purple;">**2D City Builder Tutorial Demo > 2D Top Down Sprites**</mark><mark style="color:purple;">.</mark>

<figure><img src="https://2651556506-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FeumhICLT4oHoEIEssOjB%2Fuploads%2FXzxmT6yK8bOv14fZWTej%2Fimage.png?alt=media&#x26;token=64a09b54-1fa0-414f-916a-6ee668853103" alt=""><figcaption></figcaption></figure>

Since we cannot use the previously created **Buildable Grid Object Category SO - TopDown Tutorial** asset (as it’s for Grid Objects), follow these steps:

* Right-click in the **Buildable Objects SO Assets** folder and select:\ <mark style="color:purple;">**Create > SoulGames > Easy Grid Builder Pro 2 > Buildable Free Object Category SO**</mark><mark style="color:purple;">.</mark>
* Rename the new asset to **Buildable Free Object Category SO - TopDown Tutorial**.
* Drag and drop this asset into the **Buildable Object Category SO** property of the **Buildable Free Object SO - TopDown Tree** asset.

For the **Buildable Object UI Category SO**, we could use a different asset to show the object in a new UI category. However, for simplicity, we’ll reuse the existing **Buildable Object UI Category SO - Houses**. Assign it to the **Buildable Object UI Category SO** property.

Add **two elements** to the **Random Prefabs** section by clicking the **+** button twice. For the **First Element**:

* **Object Prefab**: Assign the **TopDown Tree 01 Buildable Free Object Prefab**.
* **Ghost Object Prefab**: Assign the same **TopDown Tree 01 Buildable Free Object Prefab**.
* **Probability**: Set to **50** (50%).

For the **Second Element**:

* **Object Prefab**: Assign the **TopDown Tree 02 Buildable Free Object Prefab**.
* **Ghost Object Prefab**: Assign the same **TopDown Tree 02 Buildable Free Object Prefab**.
* **Probability**: Set to **50** (50%).

With this setup, the **Buildable Free Object SO - TopDown Tree** asset will randomly choose between **TopDown Tree 01** and **TopDown Tree 02** when placing objects on the grid. Each has an equal probability of being selected.

<figure><img src="https://2651556506-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FeumhICLT4oHoEIEssOjB%2Fuploads%2FjwDqDJvFesBFGa14XesM%2Fimage.png?alt=media&#x26;token=23ef535d-73b5-4db0-950d-e113ab81f46c" alt=""><figcaption></figcaption></figure>

For **Buildable Free Objects**, you can select one of three placement types. For this object, we’ll use **Spline Placement**. Set the **Object Placement Type** to **Spline Placement**. This will reveal additional properties. Adjust them as follows:

* **Base Spacing Along Spline**: **1**\
  (Defines the space between each object along the spline.)
* **Min Spacing Along Spline**: **0.5**\
  (Specifies the minimum allowable spacing between objects, used with spline space adjustment inputs.)
* **Max Spacing Along Spline**: **2**\
  (Specifies the maximum allowable spacing between objects, used with spline space adjustment inputs.)
* **Rotate Towards Spline Direction**: **False**\
  (Prevents objects from automatically rotating to follow the spline’s direction.)
* **Input Space Change Speed**: **0.5**\
  (Controls the speed at which spacing changes when using input adjustments.)
* **Spline Tangent Mode**: **Auto Smooth**\
  (Automatically smooths spline tangents for clean curves.)
* **Closed Spline**: **False**\
  (Keeps the spline open, rather than looping into a closed shape.)

<figure><img src="https://2651556506-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FeumhICLT4oHoEIEssOjB%2Fuploads%2FLHEP10sVropLAqWZ6QlD%2Fimage.png?alt=media&#x26;token=6641b94d-aaaf-4931-be88-19e283887488" alt=""><figcaption></figcaption></figure>

And that’s it for the **Buildable Object SO** assets! Now, complete the setup by following these steps:

* Drag and drop all three **Buildable Grid Object SO** assets we created into the **Buildable Grid Object SO List** property located in the **Grid Buildables** section of the **Easy Grid Builder Pro XY** component.
* Drag and drop the **Buildable Free Object SO** asset we created into the **Buildable Free Object SO List** property in the same section.

This links the Buildable Object SO assets to the grid system, making them ready for use.

<figure><img src="https://2651556506-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FeumhICLT4oHoEIEssOjB%2Fuploads%2F9Q2rZrZoTkFgvlSWbqoq%2Fimage.png?alt=media&#x26;token=bade502b-2b36-4b4a-8ad5-f103ef476a39" alt=""><figcaption></figcaption></figure>

[^1]:
