Guest User

Untitled

a guest
Jun 21st, 2018
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. private void UpdateSelection()
  2. {
  3. if (!Camera.main) return;
  4.  
  5. RaycastHit hit;
  6. float raycastDistance = 25.0f;
  7. if (Physics.Raycast(Camera.main.ScreenPointToRay(Input.mousePosition), out hit, raycastDistance, LayerMask.GetMask("ChessPlane")))
  8. {
  9. selectionX = (int)hit.point.x;
  10. selectionY = (int)hit.point.z;
  11. }
  12. else
  13. {
  14. selectionX = -1;
  15. selectionY = -1;
  16. }
  17. }
Add Comment
Please, Sign In to add comment