I have a script attached to my camera in the FPS Prefab, and in the Update() function I have the following code which effectively shoots a ray from the camera into the world:
bool result = Physics.Raycast(transform.position, transform.TransformDirection(Vector3.forward));
When the Raycast does not hit any colliders in the scene, for example if I’m looking up at the Skybox, Physics.Raycast continuously returns False, which is expected.
However, if I point the camera at a collider in the scene, the raycast alternates between returning True/False, ie on one frame it hits the collider, on the next it doesn’t. This is true even if the camera doesn’t move (ie the input to the Physics.Raycast is identical on every frame).