Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var depth = 10.0;
- function Start ()
- {
- Cursor.visible = true;
- }
- function Update ()
- {
- if(Input.GetMouseButton(0)){
- var mousePos = Input.mousePosition;
- var wantedPos = Camera.main.ScreenToWorldPoint (Vector3 (mousePos.x, mousePos.y, depth));
- transform.position = wantedPos;
- }
- if(Input.GetMouseButtonUp(0)){
- Destroy(this);
- }
- }
Add Comment
Please, Sign In to add comment