I'm basically trying to create a laser that, via a while loop, extends or retracts instantly based on whether or not it's touching a solid. I believe that's a simple raycast.
Why does the above cause an infinite loop and freeze the game? I've tried stopping the loop if the ray is > 320 height or < 1 height, but that doesn't help either.