So I’ve been trying to figure this all out in multiple different ways but with no success. What I’m trying to do is make it so if your finger is always on the screen, then begins to move left or right it will call the code accordingly. Which in my case the current and previous touch locations as you move should be recorded. I’ve done some debugging and the delta position always remains near zero while the current position is always way higher. Is there an easy way to keep track of the position that your finger just moved from and the new position?
if (Input.touchCount > 0 && Input.GetTouch(0).phase == TouchPhase.Moved) {
touch1 = Input.GetTouch(0).position;
touch2 = Input.GetTouch(0).deltaPosition;
if(touch1.x > touch2.x) {
//move right
}
else if(touch1.x < touch2.x) {
//move left
}
}