Raycast question

Is there a way to take the Vector 3 when the Ray doesn’t hit something.
if i have a raycast that has a distance of 100, the point that the ray reaches it’s end. So if the player looks at the Sky, he would actualy turn to look at the sky.
So far i stored the last known Hit of the raycast and use that when the ray didn’t hit anything and i’m trying to find other ways to do it. i hope i made my self clear

It would have helped if you’d provided your Raycast() code, but I’ll answer in general. A Raycast() can take either a Ray or a position and a direction. The solution will be a bit different depending on which form you use. The first solution using position and direction would look like:

var lookPoint : Vector3;
var hit : RaycastHit;

if (Raycast(somePosition, someDirection, hit, 100) {
    lookPoint = hit.point
}
else {
   lookPoint = somePosition + someDirection.normalized * 100;
}

If you are using the Ray form, it would look like:

var ray : Ray = **Some Initialization **;
var lookPoint : Vector3;
var hit : RaycastHit;

if (Raycast(ray, hit, 100) {
    lookPoint = hit.point
}
else {
   lookPoint = ray.GetPoint(100);
}

You would use lookPoint as the point you want your character to look or aim, or whatever.