Sweat-causing foods can affect body odor. Your diet plays a role in the scent your body emits. Consuming certain foods, like garlic and onions, may result in an unpleasant odor.