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