333GameStudio

DrawBack

Jan 15th, 2017
597
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     var depth = 10.0;
  2.  
  3.      
  4.     function Start ()
  5.     {
  6.          Cursor.visible = true;
  7.     }
  8.      
  9.     function Update ()
  10.     {
  11.     if(Input.GetMouseButton(0)){
  12.          var mousePos = Input.mousePosition;
  13.          var wantedPos = Camera.main.ScreenToWorldPoint (Vector3 (mousePos.x, mousePos.y, depth));
  14.          transform.position = wantedPos;
  15.     }
  16.     if(Input.GetMouseButtonUp(0)){
  17.    
  18.     Destroy(this);
  19.    
  20.     }
  21.     }
Add Comment
Please, Sign In to add comment