Ray cast scripting