yo all!
Anyone know how to detect a finger press thats held down and sliding around the screen on an Android device? currently i can only detect a tap.
this is the code i have so far:
void Update ()
{
int nbTouches = Input.touchCount;
if(nbTouches > 0)
{
for (int i = 0; i < nbTouches; i++)
{
Touch touch = Input.GetTouch(i);
if(touch.phase == TouchPhase.Began)
{
Ray screenRay = Camera.main.ScreenPointToRay(touch.position);
RaycastHit hit;
if (Physics.Raycast(screenRay, out hit))
{
if(hit.collider.tag == "Coin") {
Destroy (hit.collider.gameObject);
}
}
}
}
}
}