Controller code help

Hi, I have made some progress converting my existing game from unity to unity iphone.

Would any coders be able to point me in the right direction with this script.

In normal unity I use,

var turnSpeed = 5; 
var moveSpeed = 5;  


private var y : float; 
function Update () 
{  
   // check to see if the W or S key is being pressed.  
   y = Input.GetAxis("Vertical") * Time.deltaTime * moveSpeed; 
    
   // Move the character forwards or backwards 
   transform.Rotate(y, 0, 0); 
          
}

And i have written this now for the iphone,

var turnSpeed = 5; 
var moveSpeed = 5;

var ArrowUp : GUITexture; 

private var y : float; 

function Update () 

{

for (var evt : iPhoneTouch in iPhoneInput.touches)
 		{ 
   	
   	var myArrowUp = ArrowUp.HitTest(Input.mousePosition); 
 
if (evt.phase == iPhoneTouchPhase.Stationary) 
				{ 
 
 				if(myArrowUp) 
 				{        
                Time.deltaTime * moveSpeed;
                transform.Rotate(y, 0, 0);                                
                }    
                
         } 
	} 

}

It doesn’t work but it must be close, I am activating a fire-button in a similar manner and that is working properly. Its just that time.delta bit, move speed etc. I only need the y axis as I am pivoting a gun barrel up and down.

Any assistance really appreciated :wink:

Add this to it, and make sure you take breaks between coding sessions :wink:

var turnSpeed = 5; 
var moveSpeed = 5;

var ArrowUp : GUITexture; 

private var y : float; 

function Update () 

{

for (var evt : iPhoneTouch in iPhoneInput.touches)
 		{ 
   	
   	var myArrowUp = ArrowUp.HitTest(Input.mousePosition); 
 
if (evt.phase == iPhoneTouchPhase.Stationary) 
				{ 
 
 				if(myArrowUp) 
 				{                                        
				transform.Rotate(Time.deltaTime * moveSpeed, 0, 0);
                }    
                
         } 
	} 

}