hi i was wondering if anyone could help me i want it so i can hold down the button and then the amount of times the button will contiunuestly go up every 0.5 seconds please note this will end up being a d pad for a game.
#pragma strict
var HI : Texture2D;
var touchcount = 0;
function Update ()
{
if (Input.touchCount == 1)
{
var currentTouch: Touch = Input.touches[0];
if(currentTouch.phase == TouchPhase.Began && guiTexture.HitTest(currentTouch.position))
{
//stuff happens hear
touchcount ++;
guiText.text = "Amount of times its been presed:"+ touchcount;
}
}
}