Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void Update () {
- RaycastHit hit;
- Ray ray = Camera.main.ScreenPointToRay (Input.mousePosition);
- if (Input.GetMouseButtonUp (0))
- {
- if(Physics.Raycast (ray, out hit, 100))
- {
- if(hit.collider.tag == "Tile")
- {
- print (hit.collider.transform);
- player.target = hit.collider.transform;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement