I wrote a script which checks if the left mouse button is pressed and then changes the x/y achses of the camera via the mousemoving. It is working fine for me if I use a mouse. But if I try to use the application on a touchscreen there is no way to move the camera. Do I need to change the input settings?
function LateUpdate () {
if (target) {
if (mouseButtonisDown) {
x += Input.GetAxis("Mouse X") * xSpeed * 0.02;
y -= Input.GetAxis("Mouse Y") * ySpeed * 0.02;
}
y = ClampAngle(y, yMinLimit, yMaxLimit);
var rotation = Quaternion.Euler(y, x, 0);
var position = rotation * Vector3(0.0, 0.0, -getDistance()) + target.position;
transform.rotation = rotation;
transform.position = position;
}
}
function Update() {
if(Input.GetMouseButton(0)) {
mouseButtonisDown = true;
} else {
mouseButtonisDown = false;
}
}