using UnityEngine;

public class CheckDirectlyInFront : MonoBehaviour
{
    public float range = 10f;

    // Update is called once per frame
    void FixedUpdate()
    {
        // send out a forward ray and see if anything is there
        RaycastHit hit;

        Debug.DrawRay(transform.position,transform.forward * range, Color.red);
        if(Physics.Raycast(transform.position, transform.forward, out hit, range))
        {
            print("hi, " + hit.transform.name);
        }
    }
}
