The genetic code: Scientists believe they have discovered, from studying four generations of a sleepwalking family, and abnormality in their chromosomes that may explain this behavior. They found an error on chromosome 20 in each of the family members, possibly explaining this specific family’s sleepwalking habits. They also found that an individual who possessed this “sleepwalking gene” had a 50% chance of passing it to their offspring. While this error on the chromosome is most likely not the case for all sleepwalkers it could be a good sign for doctors to better understand their patient’s health. However, experts understand that sleepwalking generally runs in families.

https://www.bbc.com/news/health-12265572

Other triggers of sleepwalking: There are many other factors that could play into why an individual is sleepwalking. One main factor could be their stress level. Other factors include: fatigue, interrupted sleep, illness, fever, certain medications, going to bed with a full bladder, noises, migraines, or head injuries. Ways this is treated can include hypnosis, therapy, establishing routine sleep patterns, cutting back on liquids before bed, avoiding caffeine before bed, and sleeping in a quiet environment. The route of treatment chosen depends on the severity of the sleepwalking.