What causes your skin to get goose bumps in cold weather, or your palms to sweat when feeling anxious? Scientists have found the answer: specific nerve cells that are triggered in the body during times of emotional distress.

The sympathetic nervous system — the biological processes that regulate locomotion, ingestion, body temperature and the fight-or-flight response — was previously thought to be nonspecific, meaning that it caused the body to produce the same response no matter what stimulated it.

However, a team of researchers has now mapped the nerve cells that carry the sympathetic nervous system's messages around the body, and found that there are at least eight distinct types of nerve cells that activate different responses. One type of nerve makes nipples go hard, another contracts the tiny muscles around hair follicles, making them stand up and produce goose bumps, the researchers said. [10 Things You Didn't Know About the Brain]

"We’ve shown that the sympathetic system consists of many types of neuron that regulate specific functions in the body,” the study’s lead author, Alessandro Furlan, a graduate student in medical biochemistry and biophysics at Karolinska Institutet in Sweden, said in a statement. "For example, one thing we found was that goose bumps and nipple erection are caused by neurons that are specialized to regulate these functions by controlling the erectile muscles in these tissues."

To map the systems, the team worked with mice, and traced the sympathetic nervous system nerves from the spinal cord to where they connect with other structures in the body, such as muscles or blood vessels. The researchers studied the nerve cells for genetic differences and determined the nerves could be divided into eight distinct types with unique genetic signatures. Although all of the nerves in a given individual have the same genes, these genes may be turned on at different levels in different cells. The researchers determined the distinct nerve cell's paths controlled various reactions, including goose bumps, hard nipples, sweating and blood flow. Three of the nerve cell types have not yet been connected to a reaction.   

The researchers said they were surprised by the varied and specialized nerve cells, and the organs they control. Their findings suggest the sympathetic nervous system is organized into specific nerve cells to ensure they connect to the right part of the body.

The findings may point toward a better understanding of how the nervous system is formed during gestation, and how the different neuron types control the body's functions, the researchers said.

The study was published online Monday (Aug. 29) in the journal Nature Neuroscience.

Original article on Live Science.

Copyright 2016 LiveScience, a Purch company. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.