Ok so heres my code from this section:
When i run it occasionally it will display the distance but most of the time nothing is displayed after "distance: " just every now and then when scanning the environment itll flash up the distance. Any one got any ideas?
You currently have the ray length set to 1000 units. "Physics.Raycast (ray, hit, 1000)"
Objects without colliders, and objects beyond this distance of 1000 units will not register a collision, and therefore not report a distance. Hope that helps!
After checking out the script in game it looks like it was getting confused casting the number into string. I had the same flashing problem, but changing the GUI call to this:
Seems to have fixed the problem, ensuring that distanceaway was interpreted as a string.