How can I get the location the player is looking?

3GS Game Studio has a neat guide on it, they also provide a ffree Plugin on the Market Place that enables what theyre covering with less additional BP/CPP

Its applicable for first person as well.