using UnityEngine;
using System.Collections;
public class raycast_player : MonoBehaviour {
RaycastHit ray;
public GameObject hedef;
void Start () {
}
void FixedUpdate () {
if (Physics.Raycast (transform.position, transform.forward, out ray,100))
{
if (ray.collider.gameObject == hedef)
{
Destroy(hedef);
}
}
Debug.DrawRay (transform.position, transform.forward, Color.red);
}
}