I forget Unity all. Human is amazing.
How to get tap in Unity is the following,
// Update is called once per frame
void Update () {
if (Input.touchCount > 0) {
Touch myTouch = Input.GetTouch (0); // get first tap
// Touch[] myTouches = Input.touches; // if you get multi tap
// for(int i = 0; i < Input.touchCount; i++){} // process in for loop
// process for tap
Vector2 vec2 = myTouch.position;
Debug.Log("(" + vec2.x + ", " + vec2.y + ")" );
// start, move, and finish of tap
if(myTouch.phase == TouchPhase.Began)
{
// start tap
}
else if (myTouch.phase == TouchPhase.Moved)
{
// move tap
}
else if (myTouch.phase == TouchPhase.Ended)
{
// finish tap
}
}
}
Add the above script to any object.
References: