Question: why are gnats attracted to light?
Answer: Fungus Gnats Biology and Habits Gnats reproduce in decaying organic matter that is moist and shaded. The larvae feed on fungus growing in the soil and moist organic matter. ... Adult Gnats are very attracted to light and so can be found flying in windows and around lamps.