I am shooting raycasts and was wondering if there is a way to set a size for the raycast? Right now its shooting forever until it hits something. Im trying to set a specific length or size to the raycast.
RaycastHit hitInfo;
Vector3[] direction = new Vector3[5];//Array of Raycasts
void Raycasting(){
this.direction[0] = transform.TransformDirection (new Vector3(-1f,0f,3))*3;
this.direction[1] = transform.TransformDirection (new Vector3(-.5f,0f,3))*3;
this.direction[2] = transform.TransformDirection (new Vector3(0f,0f,3))*3;
this.direction[3] = transform.TransformDirection (new Vector3(.5f,0f,3))*3;
this.direction[4] = transform.TransformDirection (new Vector3(1f,0f,3))*3;
}