Piles of pillows, yoga mats, sleeping mats and bags surrounded them. Others came with bags of chips or stuffed animals.

O’Shea and Niland did not know what to expect as they prepared to sleep in one of four designated plazas in Times Square along with some 900 others to raise awareness about homelessness.

Although he would spend the night in a sleeping bag with no food as temperatures dipped to the mid-20s, O’Shea said that when he returned to his Upper West Side home Sunday morning, he would come back to a bed, shower and heat.

“I can’t ever relate to the helplessness and hopelessness of being truly homeless because I really do have those keys in my pocket, but at least for one night we are creating awareness to imagine what it’d be like sleeping outside,” O’Shea, 54, said.

The gathering Saturday, called the World’s Big Sleep Out, was organized by Josh Littlejohn, the owner of a chain of Scottish sandwich shops and an advocate for providing jobs, shelter and housing for people who need them. He described homelessness as a crisis that all countries have an obligation to address.

Thousands of people agreed to sleep outside overnight in at least 50 cities, including New York, London and New Delhi, to raise awareness of the problem of homelessness and the need for money to fight it.

Like many who take part in charity walks or runs, participants in Littlejohn’s event have collected pledges for donations from supporters.

In New York, people committed to spending the night in sleeping bags in Times Square, surrounded by the area’s pulsating lights and neon signs. Actor Will Smith read a “bedtime story” to the crowd.

There was star power in other major cities. Musicians Jake Bugg and Tom Walker performed, and actress Helen Mirren read to participants in Trafalgar Square in London. Ziggy Marley, Ellie Goulding, Meghan Trainor and Sean Kingston entertained those taking part at the Rose Bowl in Pasadena, California.

The sleep out, Littlejohn emphasized, was “in no way an emulation of actually being homeless.” But, he added, those who spend the night outside would “undoubtedly leave with a different sense of perspective and a heightened sense of compassion.”

There are an estimated 3,900 homeless people living on New York City’s streets. Just how dangerous such a life can be was underscored in October, when four homeless men were bludgeoned to death as they slept on the sidewalks of Chinatown in Manhattan. The accused killer, a 24-year-old man, was homeless himself.

Littlejohn has set a fundraising target of $50 million for his event. Half the money would go to nonprofit groups that deal with homelessness in the communities where the donations come from, like the Coalition for the Homeless in New York.

The other half is to go to charities around the world like UNICEF that help people displaced not only by extreme poverty, but also by armed conflict and natural disasters.

The sleep out will be followed by a political drive led by the Institute of Global Homelessness, an advocacy group with a goal of eliminating unsheltered homelessness in 150 cities and countries by 2030. The group plans to work with governments in different countries to come up with ways of addressing the problem.

Louise Casey, a former British government official with expertise in social services, is the institute’s chairwoman. When Tony Blair was Britain’s prime minister, he appointed Casey as the country’s “homelessness czar.”

She said she was disheartened by the rising number of people living on the street in Britain and elsewhere. She recently visited California, where an increase in income inequality and a lack of affordable housing have combined to push many people into homeless encampments.

“I was shellshocked,” Casey said. “What in God’s name is happening here? I’ve never seen anything like it, and I’ve been to every continent.”

Littlejohn, 33, said he had no idea that he would become interested in finding international solutions to homelessness when he opened Social Bite, an Edinburgh sandwich shop, about seven years ago.

Pete Hart, who hawked The Big Issue, a magazine meant to give homeless people a way to make money without panhandling, was a fixture in front of the shop.

“He came into the cafe and he sort of plucked up the courage and he asked us if he could have a job,” Littlejohn said.

After Hart began working in the kitchen, he told Littlejohn that his brother Joe also lived on the street and needed a job.

Littlejohn was soon employing both brothers and their friends. He was also feeding up to 50 people a day, asking customers to “pay it forward” by buying meals that could be given to homeless people.

In 2016, in an early version of the event Saturday, Littlejohn persuaded about 270 Scottish business leaders to sleep overnight in an Edinburgh park to call attention to the problem. Last year, with land that had belonged to the City of Edinburgh, Social Bite opened about a dozen small homes as stable housing for people who had lived on the streets.

Joe Hart, 30, works in construction now and is no longer homeless. He said he found it hard to believe that asking for a job at the sandwich shop years ago had wound up making him a part of an international campaign to raise money and awareness for trying to end homelessness.

He recalled his own life on the streets and how poorly some passersby had treated him. “People look down on you,” he said, adding that some of them would even “be spitting on you.”

Hart said he hoped that Littlejohn’s campaign would make the public more sympathetic.

“It’s not everyone’s choice to end up on the street,” he said. “It’s not a choice to end up like that.”

This article originally appeared in The New York Times .