# How to rotate and scale an object?

To rotate and scale an object, first ensure that the **Manipulation Handler (Script)** and **Near Interaction Grabbable (Script)** components are added to the object. The **Manipulation Handler (Script)** allows you to manipulate an object while the **Near Interaction Grabble (Script)** allows the object to respond to near hand interactions.

To add the scripts to the object, first select the object in the Hierarchy window. In the Inspector window, click **Add Component** and search for each script. Once found, select the script to add to the object.

![Manipulation Handler Script](https://1227696974-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LoMjAI1irMPA8c0ezFQ%2Fuploads%2Fgit-blob-266e959387e715f17d857783ef43cd7bd6afc2be%2Fmanipulation_handler.png?alt=media)

With the object selected, in the Inspector window, navigate to the **Manipulation Handler (Script)** component to modify the component's parameters.

![Manipulation Handler parameters](https://1227696974-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LoMjAI1irMPA8c0ezFQ%2Fuploads%2Fgit-blob-f63eaa26528a8922b042203c8f341e2287bcddad%2Fmanipulation_handler_parameters.png?alt=media)

You can rotate an object using one or two hands. This setting is dependent on the **Manipulation Type** parameter. The **Manipulation Type** can be limited to either:

* One Handed Only
* Two Handed Only
* One and Two Handed

Select **Two Handed Only** for **Manipulation Type** so that the user can only manipulate the object with two hands.

![Manipulation Type](https://1227696974-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LoMjAI1irMPA8c0ezFQ%2Fuploads%2Fgit-blob-76fca8a4680cc7b8bb2332227ca19f6bbe54f02d%2Fmanipulation_type.png?alt=media)

To limit the two handed manipulation to rotating and scaling, change **Two Handed Manipulation Type** to **Rotate Scale**.

![Rotate and Scale](https://1227696974-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LoMjAI1irMPA8c0ezFQ%2Fuploads%2Fgit-blob-1cf5073caf140c73ce9c3ffb4533c69777f983bb%2Frotate_scale.png?alt=media)

To limit whether the object can be rotated on the x, y or z axis, change **Constraint on Rotation** to your preferred axis.

![Rotation Constrain](https://1227696974-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LoMjAI1irMPA8c0ezFQ%2Fuploads%2Fgit-blob-92a9e55faa22572e9f64235082eda27a8298ad13%2Frotation_constraint.png?alt=media)

You can now test rotating and scaling the object using the in-editor simulation. Press the **Play** button to enter Game mode. Once in Game mode, press **T** and **Y** on the keyboard to toggle both hands. This will permanently display both hands in Game mode. Press the space bar to move the right hand and use left mouse click + **Shift** to move the left hand. While either controlling the left or right hand, use the mouse to rotate and scale the object.

![Rotate interaction](https://1227696974-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LoMjAI1irMPA8c0ezFQ%2Fuploads%2Fgit-blob-2e7d616beda338889a61a9b222f72a904f569210%2Fhololens2_boundingbox_rotate.gif?alt=media)
