- Home /
 
               Question by 
               Odrakkon · Mar 30, 2012 at 02:49 PM · 
                androidiphonetouchinputmanagercharactermotor  
              
 
              InputManager vs iPhone/Android
Hi,
I've got a question I think it would be resolved, but I can´t find it. I'm developing a 2D Platform Game and I don't know how to make iPhone or Android do jumping (pressing left half of the screen) as Mac or PC do when I press Left Control (InputManager). I'm using the standard CharacterMotor.js in Unity.
Could somebody help me?
Ty. ^^
               Comment
              
 
               
              Answer by gregzo · Mar 31, 2012 at 07:37 PM
Read about Input.GetTouch()!
Example, if you want it to work only when one finger is touching the screen:
 if(Input.touchCount==1)
 {
     if(Input.GetTouch(0).position.x<Screen.width/2 && Input.GetTouch(0).phase==TouchPhase.Began)
     {
            Jump();
     }
 }
Answer by Odrakkon · Apr 05, 2012 at 05:11 PM
Ok, thanks. The real problem was that "somebody" changes CharacterController.js...
I'm using Input.GetTouch for shooting and it works fine... ;)
Your answer
 
 
              koobas.hobune.stream
koobas.hobune.stream 
                       
                
                       
			     
			 
                