Skip to content

Commit ee96ba6

Browse files
committed
added the hability to choose if you want mousedrag to rotate or not
1 parent 67b1b30 commit ee96ba6

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

rotation.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,9 @@ function Update () {
8888

8989
// Do the rotation of the GameObject according to the mouse drag action
9090
function OnMouseDrag() {
91-
var h : float = horizontalSpeed * Input.GetAxis ("Mouse X");
92-
var v : float = verticalSpeed * Input.GetAxis ("Mouse Y");
93-
transform.Rotate (v, -h, 0);
91+
if (mouseDrag == true) {
92+
var h : float = horizontalSpeed * Input.GetAxis ("Mouse X");
93+
var v : float = verticalSpeed * Input.GetAxis ("Mouse Y");
94+
transform.Rotate (v, -h, 0);
95+
}
9496
}

0 commit comments

Comments
 (0)