im trying to perfect my multi-touch script to work.
does this code look like it should work? I cant find whats wrong with it. i can only press one guitexture button at a time, not together
function Update ()
{
if( Input.touchCount == 0 )
{
TAPPED = false;
HELD = false;
timeHeld = 0;
}
for (var i = 0; i < Input.touchCount; ++i)
{
if ( gui.HitTest(Input.GetTouch(i).position) )
{
if( Input.touchCount > 0 && Input.GetTouch(i).phase == TouchPhase.Began )
{
//do stuff
}
else if( Input.touchCount > 0 && Input.GetTouch(i).phase == TouchPhase.Stationary )
{
//do other stuff
}
else if( (Input.touchCount > 0 && Input.GetTouch(i).phase == TouchPhase.Ended) )
{
//reset stuff
}
}
}
}