We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 67b1b30 commit ee96ba6Copy full SHA for ee96ba6
rotation.js
@@ -88,7 +88,9 @@ function Update () {
88
89
// Do the rotation of the GameObject according to the mouse drag action
90
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);
+ if (mouseDrag == true) {
+ var h : float = horizontalSpeed * Input.GetAxis ("Mouse X");
+ var v : float = verticalSpeed * Input.GetAxis ("Mouse Y");
94
+ transform.Rotate (v, -h, 0);
95
+ }
96
}
0 commit comments