Advertisement
Guest User

Untitled

a guest
Feb 9th, 2016
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.34 KB | None | 0 0
  1. void Update () {
  2.  
  3.         RaycastHit hit;
  4.         Ray ray = Camera.main.ScreenPointToRay (Input.mousePosition);
  5.  
  6.         if (Input.GetMouseButtonUp (0))
  7.         {
  8.             if(Physics.Raycast (ray, out hit, 100))
  9.             {
  10.                 if(hit.collider.tag == "Tile")
  11.                 {
  12.                     print (hit.collider.transform);
  13.                     player.target = hit.collider.transform;
  14.                 }
  15.             }
  16.         }
  17.    
  18.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement