Android input touch

function Update () {

	//Rileva il tocco
	if((Input.touchCount>0) && (Input.GetTouch(0).phase == TouchPhase.Ended))
	{
		mappa[5,5].GetComponent.<Click>().toccato=1;	
//		for (var k=0; k<size; k++) {
//		
//			for (var n=0; n<size; n++) {
//			
//				if (mappa[k,n]==GetClickedItem(Input.GetTouch(0).position)) {
//					var appActive : int;
//					appActive=mappa[k,n].GetComponent.<Click>().activate;
//					if (appActive==1) {
//						mappa[k,n].GetComponent.<Click>().toccato=1;	
//					}						
//				}
//			
//			}
//		}
	
	}

	cameraSet();

}

function GetClickedItem(pos: Vector2)
{
	var camera : Camera = Camera.main;
	var p : Vector3 = camera.ScreenToWorldPoint(Vector3 (pos[0], pos[1], camera.nearClipPlane));
	var hit : RaycastHit;
	
	if(Physics.Raycast(p, Vector3(0.0,0.0,1.0), hit))
		return hit.collider.gameObject;
	else
		return null;
	
	
	
}

I would like to know why not detect the touch.

It 's all right, but the screen does not feel the touch. I tried using a device with Android and Android emulator

Help me please :confused:

Start with a very very simple touch routine. Take out all the actual game stuff and just concentrate on making the touch work in a simplistic way with a simple foolproof debug indicator. Once you can SEE the touch working put the other stuff back in.

One thing to note, I could be wrong here but it seems an issue of logic.

Logic :

If a touch phase has ENDED there is no touch anymore… correct?

so

if((Input.touchCount>0) && (Input.GetTouch(0).phase == TouchPhase.Ended))

will only work if you place one finger on screen. Place second finger on screen (or more). Remove 1 finger.