Shoot out a ray which travels a certain distance until it collides with something.
This script comes with a demo showcasing what it can do, along with a commented description on how the script works and what it returns.
End User Licence Agreement (EULA).