> For the complete documentation index, see [llms.txt](https://www.xrdev.app/mixed-reality-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.xrdev.app/mixed-reality-docs/lessons/lesson-3/project/how-to-style-bounding-box.md).

# How to style Bounding Box?

Bounding boxes make it easier and more intuitive to manipulate objects with one hand for both near and far interaction by providing handles that can be used for scaling and rotating. A bounding box will show a cube around the hologram to indicate that it can be interacted with. The bounding box also reacts to user input.

You can add a bounding box to an object by adding the BoundingBox.cs script as a component of the object.

To add the **Bounding Box (Script)** component to an object, first select the object in the Hierarchy window. In the Inspector window, click **Add Component** and search for **Bounding Box**.

Select the **Bounding Box** script to apply the component to the object. The bounding box is only visible in Game mode. Press play to view the bounding box. By default, the HoloLens 1st gen style is used.

To reflect the MRTK bounding box style, you need to change the parameters inside the **Handles** section of the **Bounding Box (Script)** component.

### Change Handle Color

You can change the color of the handles by assigning a material to the **Handle Material** property.

In the **Handles** section, click the circle icon to open the **Select Material** window.

In the **Select Material** window, search for **BoundingBoxHandleWhite**. Once found, select to assign the color to the handle material.

When you press play, the handle colors for the bounding box will be white.

### Change Handle Color When Object is Grabbed

You can change the color of the handles when an object is grabbed by assigning a material to the **Handle Grabbed Material** property.

In the **Handles** section, click the circle icon to open the **Select Material** window.

In the **Select Material** window, search for **BoundingBoxHandleBlueGrabbed**. Once found, select to assign the color to the handle material.

When you press play, grab one of the handles of the bounding box. The color of the handle will change to blue.

### Change Scale Handles

You can change the scale handles in corners by assigning a scale handle prefab in the **Scale Handle Prefab** and **Scale Handle Slate Prefab** (for 2D slate) parameters.

First, assign a prefab to the **Scale Handle Prefab**. In the **Handles** section, click the circle icon to open the **Select GameObject** window.

In the **Select GameObject** window, switch to the **Assets** tab and search for **MRTK\_BoundingBox\_ScaleHandle**. Once found, select to assign the prefab to the scale handle.

Next, assign a prefab to the **Scale Handle Slate Prefab**. In the **Handles** section, click the circle icon to open the **Select GameObject** window.

In the **Select GameObject** window, switch to the **Assets** tab and search for **MRTK\_BoundingBox\_ScaleHandle\_Slate**. Once found, select to assign the prefab to the scale handle.

When you press play, grab one of the handles of the bounding box to see the change in how the scale handle look.

### Change Rotation Handles

You can change the rotation handles by assigning a rotation handle prefab in the **Rotation Handle Prefab** parameter.

In the **Handles** section, click the circle icon to open the **Select GameObject** window.

In the **Select GameObject** window, switch to the **Assets** tab and search for **MRTK\_BoundingBox\_RotateHandle**. Once found, select to assign the prefab to the scale handle.

When you press play, grab one of the handles of the bounding box to see the change in how the scale handle look.


---

# 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://www.xrdev.app/mixed-reality-docs/lessons/lesson-3/project/how-to-style-bounding-box.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.
