Gnats fly in your face mainly because they are attracted to moisture (like sweat and tears), carbon dioxide from your breath, and certain scents such as shampoos and perfumes. They seek moisture and salt, which can be found on the skin and around the eyes, mouth, and nose. Additionally, the carbon dioxide exhaled signals a potential feeding or breeding opportunity for them. Some gnats are also drawn to pleasant fruity or sweet smells from personal care products. Overall, their attraction to the warmth, moisture, and scents on a human face leads them to hover there persistently.