Iphone multiple touch code help needed

I currently have this code working nicely to make somthing move on screen when touched on a gui texture.

var turnSpeed = 5; 
var moveSpeed = 10;

var ArrowLeft : GUITexture; 
var ArrowRight : GUITexture;

private var x : float; 

function Update () 

{

x=0;

for (var evt : iPhoneTouch in iPhoneInput.touches)
 		{ 
   	
   	
   	var myArrowLeft = ArrowLeft.HitTest(Input.mousePosition); 
	var myArrowRight = ArrowRight.HitTest(Input.mousePosition);
	
if (evt.phase == iPhoneTouchPhase.Stationary) 
				{ 
 
 				if(myArrowLeft) 
 				{                                        
				transform.Rotate(Time.deltaTime * turnSpeed, -1, 0);
                }    
                if(myArrowRight)	
                {
                transform.Rotate(Time.deltaTime * turnSpeed, 1, 0);
                }
                
         } 
	} 

}

I need to be able to fire at the same time using very similar code for the fire button.

Any ideas the firebutton cant be used while the movement is taking place.

the manual talks about this, static var multiTouchEnabled : bool

Any code help welcome :wink:

Hi starkiwi,

Your already set to process multi-touch, you’re already processing all touch events, you just need to add an additional if condition (and just a suggestion, move your hit test inside the condition you want processed - simple performance reasons, if you aren’t in the event you’re looking for why do the raycasts?) I modified your code below: