Just wondering if someone could give me some insight on why I cannot increase my raycast ray.
It seems as if it just defaults to 1 unit length.
In float maxDistance parameter, it is ignoring my rayDistance float… What am I missing??
private float rayDistance = 15;
void Update ()
{
RaycastHit hit;
Ray aimRay = new Ray(transform.position, transform.forward);
if (Physics.Raycast(aimRay, out hit, rayDistance))
{
if (hit.collider.tag == "Player")
{
Debug.Log("Hit Player");
}
}
}