A distracted driver was cruising through a busy downtown area one sunny afternoon, dodging one potential car accident after another as he checked his cellphone.

As he looked down at the phone instead of at the road, the driver’s luck finally ran out. Another vehicle slammed into the car as it neared a stop sign.

That was one of the scenarios presented in a virtual reality headset, part of a program in which the “driver” sits behind the wheel of a miniature car. The simulator, set up under a tent for several hours along the boardwalk in Long Beach on Sunday, was designed to show the dangers of texting while driving.

The two-minute simulation, part of AT&T’s “It Can Wait” campaign, is an interactive video that shows how an inattentive driver can get into accidents.

The first scenario has the driver going through a neighborhood while looking down at a cellphone placed in a cup holder and nearly hitting a group of children playing in the street.

In another scenario, the distracted driver is answering a cellphone while negotiating a busy highway.

advertisement | advertise on newsday

Eventually another car slams into the side door of the driver, who never saw the other vehicle coming because of texting.

The scenarios were all too real for Cindy Siegel, 62, of Long Beach, who said she was hit by a texting driver two years ago in Oceanside.

“It was so dangerous. We weren’t moving that fast but it could have been disastrous,” she said.

Of the simulator, Siegel said, “It was like being on a roller coaster. It was scary. It was out of my control.”

Ryan Hill, 40, of Forest Hills, Queens, who also tried the simulator, described himself as “very much a defensive driver.” But he said, “The simulation gives you a working experience of driving while texting.”

Another who tried it was Ricky Holoday, 21, of Island Park. “I really don’t approve of texting and driving,” he said. “I just feel that a driver should have both hands on the wheel.”