You can get the position where the ray first hit the wall. Then, you make another ray a few studs in front of where the first ray hit, but make it go in the opposite direction so it hits the wall. Then you get the positions of both rays and get the magnitude.
is. If I do it in very small increments until it hits the same wall, I may end up firing 1000 rays per frame, if for example the initial ray hit a very thick wall at a very sharp angle.
It also wont be viable in million other cases. For example if ray hits a table of a leg at an angle looking at it’s top surface, then if I fire back, it will still hit the table, so I will get the illusion that I hit the same object, when in fact I hit very different surfaces with completely different thickness.