Joystick to movement and rotate camera same time

Hello,

I have a problem.
I want to use joystick to movement player.
I want to rotate camera if player click ANYWHERE ELSE on screen.

alt text

My problem:
If the player use joystick then camera rotate too!
I tried IsPointerOverGameObject not good, because player press the joystick and drag it to the screen then joystick still work, but camera rotate again :frowning:
So I think if player use joystick then I disable rotate camera, but not good, because If player use two fingers it is possible both at the same time. (one finger joystick and one finger screen)

	public float speed = 2.0f;
	private float X;
	private float Y;



	void Update() {

		if (Input.GetMouseButton (0)) {
	
		
			if(!EventSystem.current.IsPointerOverGameObject ())  {


					transform.Rotate (new Vector3 (Input.GetAxis ("Mouse Y") * speed, -Input.GetAxis ("Mouse X") * speed, 0));
					X = transform.rotation.eulerAngles.x;
					Y = transform.rotation.eulerAngles.y;
					transform.rotation = Quaternion.Euler (X, Y, 0);
				}
			
			}

		}

So another solution is needed.
If player use the joystick, do not move the camera.
But if player use it with two fingers (one with the joystick and the other with the camera allowed!)
I hope you understand. (similar to other shooting games).

Thanks!

Did you find the answer?