So the following code gets the distance of a ray cast, I was just wondering how I could split the results so that I could have seperate values for x, y and z.
var ray = mainCamera.ScreenPointToRay (Input.mousePosition);
Debug.Log(ray.GetPoint(distance));