Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using System.Collections;
- public class player : MonoBehaviour {
- public GameObject[] targets;
- public Transform[] followTargets;
- int layerMask = 1 << 8;
- void Update()
- {
- if (Input.GetButtonDown("Fire1"))
- {
- Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
- RaycastHit hit;
- if (collider.Raycast(ray, out hit, 5000.0F) && Physics.Raycast(ray, out hit, Mathf.Infinity, layerMask))
- {
- Debug.Log("Osumme johonki!");
- }
- //Debug.DrawLine(ray.origin, hit.point);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement