# How to tweek MouseOrbit script

**URL:** https://discussions.unity.com/t/how-to-tweek-mouseorbit-script/423933
**Category:** Scripting
**Tags:** Scripting
**Created:** [September 26, 2010, 1:41pm UTC](https://discussions.unity.com/t/how-to-tweek-mouseorbit-script/423933 "2010-09-26T13:41:30Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![anon\_75310587](https://avatars.discourse-cdn.com/v4/letter/a/a9adbd/32.png) [@anon\_75310587](https://discussions.unity.com/u/anon_75310587)
#### Post date: [September 26, 2010, 1:41pm UTC](https://discussions.unity.com/t/how-to-tweek-mouseorbit-script/423933/1 "2010-09-26T13:41:30Z")

</div>

Hi, how to tweek the MouseOribit to make it work as inside the Unity3D IDE environment. That is, only when you hold down the right mouse button that you can rotate the camera, instead of rotating all the times with the mouse.

---

<div class="post-metadata">

### Author: ![anon\_87959774](https://avatars.discourse-cdn.com/v4/letter/a/ac91a4/32.png) [@anon\_87959774](https://discussions.unity.com/u/anon_87959774)
#### Post date: [September 27, 2010, 6:24am UTC](https://discussions.unity.com/t/how-to-tweek-mouseorbit-script/423933/2 "2010-09-27T06:24:55Z")

</div>

sorround the code in the update method with an if statement like this

if(Input.GetMouseButton(0))  
{  
// paste here the whole content of the update method  
}

thats it

---

<div class="post-metadata">

### Author: ![anon\_75310587](https://avatars.discourse-cdn.com/v4/letter/a/a9adbd/32.png) [@anon\_75310587](https://discussions.unity.com/u/anon_75310587)
#### Post date: [September 27, 2010, 7:31am UTC](https://discussions.unity.com/t/how-to-tweek-mouseorbit-script/423933/3 "2010-09-27T07:31:29Z")

</div>

> [@anon\_87959774](#):
>
> sorround the code in the update method with an if statement like this
> 
> if(Input.GetMouseButton(0))  
> {  
> // paste here the whole content of the update method  
> }
> 
> thats it

No, that never works.

---

<div class="post-metadata">

### Author: ![andeeeee](https://avatars.discourse-cdn.com/v4/letter/a/51bf81/32.png) [@andeeeee](https://discussions.unity.com/u/andeeeee)
#### Post date: [September 27, 2010, 8:15pm UTC](https://discussions.unity.com/t/how-to-tweek-mouseorbit-script/423933/4 "2010-09-27T20:15:11Z")

</div>

It’s actually GetMouseButton(1) for the right mouse button.
