multi touch - missing one small thing?

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 :frowning:

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
    		}
    	}
	}
}

You are running that in Update() - GUI stuff usually only happens in OnGUI.

The way the GUI system works is that the OnGUI routine is called multiple times per frame with different events, sometimes drawing, sometimes hit testing etc. I’m not sure what would happen if you did a hit test in the Update, but I’d bet that’s it as Unity will work out where something is in preparation for OnGUI.