You can use target for that. The target vector is set to the world position of the point where your trace hits the surface. Its z is it.