Advertisement
Guest User

Untitled

a guest
Nov 17th, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.38 KB | None | 0 0
  1. private bool CameraMovement()
  2.     {
  3.         Vector3 mousePos = Input.mousePosition;
  4.         mousePos.z = 10;
  5.  
  6.         Vector3 screenPos = Camera.main.ScreenToWorldPoint(mousePos);
  7.  
  8.         RaycastHit2D hit = Physics2D.Raycast(screenPos, Vector2.zero);
  9.  
  10.         if (hit)
  11.         {
  12.             print(hit.point);
  13.             return true;
  14.         }
  15.  
  16.  
  17.         return false;
  18.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement