Debug.Log error on touch

Hi guys, I am simply trying to trace some info when I touch the iphone but get an error. The code is as follows…

for(touch in iPhoneInput.touches){ 
               
      	 var touch : iPhoneTouch = iPhoneInput.GetTouch(1); 	

     	 
     	 if(touch.phase == iPhoneTouchPhase.Moved||touch.phase == iPhoneTouchPhase.Began)
      			{ 

        	 Debug.Log("this text gives me an index out of bounds error");
 
				} 

       
     }

I have to say, I am new to Unity and iphone development and I’m finding it very tough to get into the scripting. …a simple command like this giving errors really feels like a kick in the teeth. I am use to flash development where Trace() works no matter what :slight_smile:
There seems to minimal info out there for iphone development.(A couple of pages in the manual and thats it.) Although I find that you guys here are VERY helpful,and I am grateful the example projects seem to be too overcomplicated to extract much from. Is there a set of iphone resources or help pages somewhere which are a bit more bitesize ? Don’t get me wrong, I am willing to really push myself to solve these problems but any direction on how people have found the best way to learn iphone development on Unity the better. Thanks in advance and thanks for welcoming me to the community :slight_smile:

Okay I fixed my problem…

 var touch : iPhoneTouch = iPhoneInput.GetTouch(0);

…although I really have no idea how as the getTouch help is very thin.(Returns object representing status of a specific touch) I,m really not sure what the integer represents…number of touches perhaps??? What is the object that represents the status of a touch?..that sentance makes no sense to me.

Ah ha…trial and error at its best. I just discovered that the getTouch(int) is the number of touches…which is zero based. ie it returns if I use getTouch(0) with one finger or getTouch(1) if i touch the screen with two fingers…

Slowly learning :slight_smile:

…and my thought process and frustrations documented.