I am needing help on figuring out how to see if a finger is swiped across the screen. It is for a golf game. I would like to get the same code for the mouse being held down and moved across the screen. I was thinking of making waypoints on the screen and when one crossed the next one could be checked. The only thing I seen on this was maybe using a gui element for it.Thanks in advance.
Script written for mouse:
var swiped : boolean = false;
var minSwipeDistance : float = 100;
private var mousePos1 : Vector2;
function Update(){
if(Input.GetMouseButtonDown(0))
mousePos1 = Input.mousePosition;
if(Input.GetMouseButtonUp(0)){
if(Vector2.Distance(mousePos1,Input.mousePosition) > minSwipeDistance){
swiped = true;
}
}
}