Question: why are moths nocturnal but attracted to light?
Answer: Most nocturnally active moths are attracted to light, a phenomenon known as positive phototaxis. ... A better theory is that moths can use the moon or stars to orientate, and that a moth adjusts its flying track to keep the light source at a constant angle to the eye.