A green bus pulls up on a sunny day on a city street. A few passengers sit stony-faced as you step up to present your pass. Only a pair of blue hands can see your body.

A virtual reality system is designed to help people with agoraphobia by showing them scenarios that cause intense fear and distress.

Scientists say the approach helps participants build confidence and ease their fears by helping them to do tasks in real life that they had previously avoided. The study found that people with more severe psychological problems benefited the most.

The lead researcher in the work said that it leads to a step- change in people's lives.

The experience begins in a virtual therapist's office before moving to scenarios such as opening the front door or being in a doctor's surgery, each with varying levels of difficulty. Participants are asked to complete certain tasks, such as asking for a cup of coffee, and are encouraged to make eye contact or move closer to other characters.

GameChange: Improving lives through VR therapy – video

The computer-generated scenes allow participants to try something new or approach the situation in a different way.

That makes it possible for people to apply it in the real world. If you get over something in virtual reality, you will get over it in the real world.

He said that before using the system he had trouble taking a bus to visit his father's grave. He gained confidence after using the virtual reality system.

He said that it helped him for every aspect.

Virtual bus with passengers looking at participant.

The VR sessions were always conducted with a mental health worker present. Photograph: OCAP

174 patients with difficulties going outside and psychosis were randomly allocated to use virtual reality technology with their usual care, according to a report in the Lancet Psychiatry journal. 172 patients were given their usual care alone.

The group of people were given the opportunity to use the technology for six sessions, lasting 30 minutes, over the course of six weeks.

A mental health worker was in the room with the participant when they wore the virtual reality headset and worked with them to apply the learning.

The results show that six weeks after the trial began, those allocated to the therapy had a small but significant reduction in avoiding real-life situations because of agoraphobia, as well as less distress, compared with those who had only received their usual care. There was no difference between the two groups by six months.

The effect was sustained for six months for people with severe agoraphobia. The patients were able to complete two more activities than before, such as going shopping or getting on a bus.

The study can't tease out the impact of the therapy from the mental health worker and their homework, but other tests have shown no change in agoraphobia.

It was becoming easier to send virtual reality headsets to patients because of the cost.

For the patient who wanted to be able to visit his father's grave, the benefits have been much more wide-ranging than just completing tasks. I am more confident around other people.