Advertisement
S0m3guy

Untitled

Jun 13th, 2018
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.35 KB | None | 0 0
  1.     void OnMouseDown() {
  2.      
  3.            ...
  4.            ...
  5.            ...
  6.      
  7.             screenPoint = Camera.main.WorldToScreenPoint (gameObject.transform.position);
  8.      
  9.             offset = gameObject.transform.position - Camera.main.ScreenToWorldPoint (new Vector3 (Input.mousePosition.x, Input.mousePosition.y, screenPoint.z));
  10.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement