Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public Vector3 GetCursorPosition()
- {
- Vector3 mouse = Input.mousePosition;
- Ray castPoint = Camera.main.ScreenPointToRay(mouse);
- RaycastHit hit;
- if (Physics.Raycast(castPoint, out hit, Mathf.Infinity))
- {
- return hit.point;
- }
- return Vector3.zero;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement