Hi
I’m trying to cast a ray from the camera straight down. How would I do this?
My code
Ray rayDown = new Ray(transform.position, Vector3.down );
RaycastHit hitDown;
if(Physics.Raycast(rayDown, out hitDown, Mathf.Infinity))
Debug.DrawRay(rayDown.origin, hitDown.point, Color.red);
The ray starts off going from the camera straight down but if the camera moves the ray will angle its self and will no longer be pointing down.
Thanks