Hello everyone, I’m trying to find a way of directly getting the furthest point along a Ray.
What I’m doing:
-I’m making a raycast with a max distance, checking to make sure a hit.point is far enough away from the origin, then instantiating a prefab within the ray distance points (randomized min/max use of ray.GetPoint). I’ve seen that if there is no “hit” the hit.point value will remain as it was, and I can set it to some obviously fake value and check against that (therefore max distance must have been achieved if no object blocked it).
This works okay, but I’d rather just find the furthest point along the ray if possible (and I’ve seen that GetPoint() will return any value along the ray’s direction, so it isn’t reliable to check against).
Any ideas are appreciated, and if its not possible or does not make sense, telling me that works to. Thanks.