- Home /
 
 
               Question by 
               Sammyl · Aug 05, 2014 at 10:41 AM · 
                androidjavascriptraycastbuttoncontroller  
              
 
              AndoidTouchControllJavaRaycast
Hello
I am programming whit Java
I have a problem with my button in my game:
I made a game object with a meth collider
and an emty gameopbject with a script
Problem i can just click the button with my first finger mens i can't walk and hit enemy's at the same time [HELP]
script:
 #pragma strict
 
 var ray : Ray;
 var hit : RaycastHit;
 var Target : Transform;
 
 function Update () {
   
   if(Input.GetMouseButtonDown(0)){
      ray = Camera.main.ScreenPointToRay(Input.mousePosition);
      if(Physics.Raycast(ray,hit)){
          if(hit.transform.name == "Fire_Button")
             Target.SendMessage("PlayerAttack");
               Debug.Log("HitButtomGotaHit");
      
    
       }
     }
   }
 
              
               Comment
              
 
               
              Your answer