- Home /
              This post has been wikified, any user with enough reputation can edit it. 
            
 
            Click Goes Everywhere
Hello again, I wrote a smoot mouse following code here;
 var smooth:int; // Determines how quickly object moves towards position
 
 var hitdist = 10;
 
 private var targetPosition:Vector3;
  
 function Update () {
     
      
 
     if(Input.GetKey(KeyCode.Mouse0))
     {
         
         var ray = Camera.main.ScreenPointToRay (Input.mousePosition);
         
  
         
             var targetPoint = ray.GetPoint(hitdist);
             targetPosition = ray.GetPoint(hitdist);
             
         
     }
  
     transform.position = Vector3.Lerp (transform.position, targetPosition, Time.deltaTime * smooth);
 }
 
And a UI Controller as you can see here ;

I don't want to move when i click or touch to theese (gonna be) buttons. But it goes there. How can i do that ? Thanks
 
                 
                ekran alıntısı.png 
                (66.5 kB) 
               
 
              
               Comment
              
 
               
              Your answer
 
 
              koobas.hobune.stream
koobas.hobune.stream 
                       
                
                       
			     
			 
                