I made virtual joystick for space game. I also have button to fire lasers. When used by 1 finger everything is ok, fire fires lasers and joystick drags and drop by mouse down and up that guide spaceship in space.
The problem is when i put 2 fingers on screen of mobile together, the position is in the middle that cause problems that joystick is sticking to this middle position instead of finger intentionaly used to control joystick. The input i use is Input.mousePosition.
I also experimented with Input.GetTouch(0).deltaPosition and Input.GetTouch(0).position but none of them reacted on finger put on screen. (maybe i did something wrong)
void Update () {
print(Input.touchCount);
if (Input.touchCount > 0 && Input.GetTouch(0).phase == TouchPhase.Began) {
print ("click position "+Input.GetTouch(0).deltaPosition);
}
}
If anyone could help me what can i do to make this task to work i would be very thankfull.