Sometimes it’s hard to feel what we should for people in difficult situations. If you live in a large city, homeless people may have become part of the background, rather than individuals in profoundly challenging situations. One way to help people feel more compassion for others, a new study suggests, is to expose them to situations through virtual reality (VR).

Given how many people already own VR headsets, it seems like a promising opportunity.

The program showed firsthand what it was like to be homeless — to lose one’s job, sell one’s furniture and even take shelter in a bus.

“About 10 million [VR] headsets have been sold in the U.S. over the past two years,” said study author, Fernanda Herrera, in a statement. “So many people now have access to VR experiences. But we still don't know much about how VR affects people. This research is an important step in figuring out how much of an effect this technology can have on people's level of empathy in the long term.”

Over 550 participants from 15 to 88 years old took part in an immersive VR experience called “Becoming Homeless.” The program showed firsthand what it was like to be homeless — to lose one’s job, sell one’s furniture and even take shelter in a bus.

Other people, serving as control groups, read a narrative about homeless people or interacted with a two-dimensional version of “Becoming Homeless” on a computer.

People who’d had the VR experience had more compassionate attitudes toward homeless people the Stanford University team found when they tested the participants’ attitudes toward the homeless afterward. People exposed to VR experiences of homelessness were more likely to agree with statements like, “Our society does not do enough to help homeless people.” They were also more likely to sign a petition in favor of affordable housing than people in the control groups.

This was still the case up to two months later, suggesting that empathy is a trait that can be nurtured, and that the VR experience boosted empathy in an enduring way. This is likely because VR makes a person feel like they’re really living in the experience they’re viewing.

“Taking the perspective of others in VR produces more empathy and prosocial behaviors in people immediately after going through the experience and over time in comparison to just imagining what it would be like to be in someone else's shoes,“ said Herrera. “And that is an exciting finding.”

The most exciting thing, said Herrera, was that the effect persisted, profoundly affecting some of the participants, and prompting them to take action. “Long after our studies were complete,” she said, “some research participants emailed me to reflect on how they started becoming more involved in the issue afterward. One of them befriended a homeless person in their community and wrote me again once that person found a home. It was really inspiring to see that positive, lasting impact.”

The study is published in the journal, PLOS ONE.