hey
i am having a problem that is related to raycasting.
I have a ray that is attached to a camera, to make sure that it is always at the correct distance to the ground. However, when I rotate the camera, so does the ray. I thougt that transform.up was global, but I must have misread, since script reference says world space. So anyone know how to make sure the ray is always pointing directly down , global space?
ray = new Ray(transform.position, transform.up*-1);
Physics.Raycast(ray, out hit);
print("Distance to ground is: " + hit.distance);