Advertisement
Guest User

Untitled

a guest
Jan 30th, 2015
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. using UnityEngine;
  2. using System.Collections;
  3.  
  4. public class player : MonoBehaviour {
  5.  
  6. public GameObject[] targets;
  7. public Transform[] followTargets;
  8.  
  9. int layerMask = 1 << 8;
  10.  
  11. void Update()
  12. {
  13. if (Input.GetButtonDown("Fire1"))
  14. {
  15.  
  16. Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
  17. RaycastHit hit;
  18. if (collider.Raycast(ray, out hit, 5000.0F) && Physics.Raycast(ray, out hit, Mathf.Infinity, layerMask))
  19. {
  20. Debug.Log("Osumme johonki!");
  21. }
  22.  
  23.  
  24. //Debug.DrawLine(ray.origin, hit.point);
  25. }
  26.  
  27. }
  28.  
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement