# How to organize your objects into a grid view?

You can organize any objects in Unity into a grid by using an **Object collection** script. In this example, you will learn how to organize 6 3D objects into a 3 x 3 grid.

![Grid layout of boxes.](/files/-M7-xDdY0M82zIxalMGq)

First, configure your Unity scene for the Mixed Reality Toolkit. Next, in the Hierarchy window, right click in an empty space and select **Create Empty**. This will create an empty GameObject. Name the object **CubeCollection**.

![Empty CubeCollection object.](/files/-M7-xJ0QeB-lq7ji5fMW)

In the Inspector window, position **CubeCollection** so that the collection displays in front of the user (example, X = 0, Y = -0.2, Z = 2).

![Position attributes of the CubeCollection.](/files/-M7-xZqUlZblWOh2Yega)

With **CubeCollection** still selected, in the Hierarchy window, create a child **Cube** object. Change the scale of the object to x = .25, y = .25, z = .25.

![Cube transforms.](/files/-M7-xiC9gSkyfoqyfzoR)

Duplicate the child **Cube** object 8 times so that there is a total of 9 **Cube** child objects within the **CubeCollection** object.

![Duplicated cubes collection.](/files/-M7-xshdmHfWXQZNqQls)

In the Hierarchy window, select **CubeCollection**. In the Inspector window, click **Add Component** and search for the **Grid Object Collection (Script)**. Once found, select the component to add to the object.

![Add Grid Object Collection Script component](/files/-M7-y2JwC3GQRfZE61AG)

Configure the **Grid Object Collection (Script)** component by changing the **Sort Type** property to **Child Order**. This will ensure that the child objects (the 9 Cube objects) are sorted in the order you placed them under the parent object.

![Change sort type.](/files/-M7-yC98AqyjolsUGdI1)

Click **Update Collection** to apply the new configuration.

![Update Collection.](/files/-M7-yKUPpsZ5aH_dXIMj)

You can adjust the parameters within the **Grid Object Collection (Script)** component to further customize the grid. For example, you could change the number of rows to 2 by changing the value in the **Num Rows** properties. Be sure to click **Update Collection** to apply the new configuration.

![Change number of rows.](/files/-M7-yS03TSMoagpNtN4J)


---

# 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://www.xrdev.app/mixed-reality-docs/lessons/lesson-3/project/how-to-organize-your-objects-into-a-grid-view.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.
