“We’re talking a movie about trans sex workers shot on iPhones?” James Ransone says, by way of introduction, as we meet at The Golf Club at Chelsea Piers. “Let’s go hit the links!”

Ransone flashes a smile. “What a fuckin’ Republican thing to do.”

Seeing as it was Ransone’s idea to come smash balls off the spiffy multilevel driving range here on the west side of Manhattan, he’s well in on the joke. And yes, Tangerine, the movie in question, was shot on iPhones — the 5s, to be exact, and three of them, sometimes mounted on Steadicams, sometimes operated by director Sean Baker as he circled his cast on his 10-speed bicycle. And yes, it is about trans sex workers — a brilliant comic duo, to be exact, played superbly by first-time actors Kitana Kiki Rodriguez, as the rambunctious Sin-Dee, and Mya Taylor, as the elegant foil Alexandra.

It also stars Ransone, as Sin-Dee’s unfaithful, bandanna-wearing quasi-boyfriend Chester. In a movie full of unexpected delights, Ransone’s scummy charmer is one of the brightest.

It’s part of a cluster of roles — including in the upcoming Western In a Valley of Violence and Sinister 2, his first lead role in a studio movie — that have marked a career resurgence for Ransone. A dozen years ago, a season-long stint on The Wire as the tragic goofball Ziggy Sobotka earned him a strange kind of notoriety. Now, it seems, he’s ready to put Ziggy to bed.

♦♦♦

“Lay the club on the ground. Let that club do what it’s gonna do.”

“Spread your legs. Keep your arms straight. Move your hips.”

“Lay that shit on the ground, dude. See how it relaxes your whole body?”

Ransone’s in all black today — black jeans, black low-tops, black tattoos of bull-riders poking out of a threadbare black T-shirt, black hair perfectly slicked back. That, plus his penchant for playing the morally suspect, might have led you to believe he’s not the type to know what to do with a 5-iron. Or to be so sweet as to encourage me, as I shank and whiff and piddle the ball off the tee, again and again. “Yeah, see. Perfect.”

But Ransone actually spent time on golf courses growing up in Baltimore with his dad, a Vietnam veteran, and little brother. It was a juxtaposition: The rest of the time he was at the George Washington Carver Center for Arts and Technology, smoking cigarettes with the fine arts kids and doing “a lot” of acid.

He moved to New York in 1997 to study film at the School of Visual Arts, but failed out after his freshman year. For a time, he paid rent off gigs at Armani Exchange and with the nightlife photographer Patrick McMullan. Then he got an agent. “I don’t even remember how, man,” he says. “I, like, met some dude at a party and [said] ‘I think I wanna be an actor?’” He thinks for a moment. “It used to be a lot easier in the ’90s.”

Quickly, he booked a Dr Pepper commercial. “I stood there like a jerkoff looking up at the camera,” he recalls. “I was young and hip and drinking pop.” He started living off the residual checks, and has been a working actor ever since.

His first major role came in 2002’s Ken Park, screenwriter Harmony Korine and director Larry Clark’s follow-up to the infamous Kids. As part of an ensemble of aggressively wayward youth, Ransone took the cake. At one point, while watching Anna Kournikova play tennis on television, Ransone’s character ties a dress to a doorknob, then wraps it around his neck and masturbates for several minutes.

With a head full of youthful vigor and the lessons of his hero Iggy Pop — “You gotta remember, man, he dressed up like a Nazi and told people he was gonna kill himself onstage!” — Ransone threw himself into the scene. “I wasn’t thinking about being an actor at all. I was thinking about, like, pushing creative boundaries. But, uh, I think it just ended up as fodder for porn sites?”

Soon after, helped in part by his ability to nail that uniquely niche Bawlmer accent, Ransone landed the role of Ziggy. Again, a penis — this time, a sizable prosthetic — played a prominent role. The character was a skinny, manic, voluble goof, with a large member of which he was very proud.

“It was like a baby’s arm!” Ransone says of the prop. “And I’m wearing it underneath my pants and I’m supposed to take it out. And our DP is this German woman named Uta Briesewitz, and she goes, ‘Eetz reading too light in ze lenz!’ And so these really sweet middle-aged makeup ladies would come over and color my fake penis as I’m standing there. And then Uta would be like, ‘Eetz ztill too light in ze lenz!’ And that was my first day of work.”

Ransone had a great time shooting The Wire. The steady work and steady paychecks didn’t hurt. “I’d go shoot my scenes and be like, ‘All right, well, I have enough money to drink this week.’ And I’d get back on the train to New York and party with my friends.”

For a while, there was no difference between Ransone’s lifestyle and that of any plucky New York twentysomething: He was living in scruffy Chinatown apartments, playing in bands, staying up to ungodly hours with fellow art-school-dropout weirdos. But then pills came into the mix.

He and his friends would hustle pads out of appointments with doctors and write out the prescriptions themselves. When a few of his pals got arrested in the process of acquiring the contraband, he decided to move on to heroin. “It was cheaper and easier to get a hold of,” he says now, sheepishly. “Purely an economic reason.”

He remembers nights waking up in the psychiatric ward at Bellevue, or beside friends swearing they’d kill him for the previous night’s transgressions. One time a kindly FDNY driver fished him out of a pile of trash. Another time, an off-duty cop witnessed him land face-up on the subway tracks.

“I was coming from band practice at 11 p.m.,” Ransone recalls. “Right off the Marcy stop, on the J. I had just missed the train and so I try to jump on the back of it to ride over the bridge. But I’m on, like, 80 Klonopin and I’m strung out, too, so my hand-eye coordination is a little off.” He landed on his back and lay there, tears running down his face. The cop, dumbfounded at the sight of it, helped him up, dusted him off, and sent him on his way.

It was around this time, also, that the Ghost of Ziggy began to linger. When the season he starred in first aired, The Wire was still safely ensconced in critically adored anonymity. Then it began to permeate the culture. And all of a sudden, people started screaming at Ransone in public.

That was surreal and disarming enough on its own. Then Ransone learned of the polarizing nature of his performance. He had played Ziggy as loud and brash and endlessly nervy, just as he was written. Some couldn’t stand the guy, which was kind of the point, and didn’t bother Ransone. Others felt he was that guy. And perhaps thanks to the vulnerability of the character, fans of The Wire were never shy in their approach.

“I remember I was getting on a flight, and there’s this guy standing behind me eating a breakfast burrito,” Ransone says. “He’s literally here” — Ransone steps forward, nearly touching foreheads with me — “going ‘ZIGGY!!!’ I said, ‘Get your fuckin’ breakfast burrito out of my face.’”

The experience of The Wire rattled Ransone in strange ways. When he was at his worst, some of his greatest support came from his friend Chris Bauer, who’d played his father, Frank Sobotka, on the show.

“As shit got pretty fucked up for me, when shit got really dark, he was there for me,” Ransone says. “He was really gentle with me, basically. He never made me feel like shit about myself. I think he might have been the first person who shepherded me into respecting my own talents.”

Eventually he went to rehab, got clean, and stayed clean. And not long after, The Wire’s creator, David Simon, called again. He was casting Generation Kill, his misadventure-in-Iraq miniseries, and he wanted Ransone.

They shot in Namibia for seven tough months, where Ransone balanced a heavy workload alongside reckless Jeep trips into the middle of nowhere with the ex-Marines hired as consultants for the show. Playing Corporal Josh Ray Person — an unstoppable motormouth hopped up on the “metabolic enhancer” Ripped Fuel — Ransone relocated his swagger, and his chops.

“James is made for an absurdist, comedic rant in whatever universe we place him,” Simon says now. “Captain Crunch as haute cuisine, or the pussy infrastructure of Iraq, or whatever. He’s built for that stuff. But then, he can turn on a dime and break your heart.”

Meanwhile, back on the driving range, Ransone notes a large boat sailing down the Hudson in front of us. “I’m trying to get it up over the net,” he announces. “I’m trying to hit that yacht.” He settles, with glee, for pinging one off the back of the cart picking up the golf balls.

♦♦♦

Ransone’s post–Generation Kill career is notable for what happened next — which is, nothing much. One would not be wrong in assuming that a starring role in David Simon’s first project after The Wire would provide one with certain opportunities. But Ransone found himself as a working actor, grinding it out.

It bothered him for a while: the lack of recognition, the lack of stature, the lack of attention. He knew, of course, that it was preposterous — craving attention for the sake of attention. “Actors just want everyone to want to fuck them,” he says. “Doesn’t matter the gender! All of them.”

So he hunkered down, focused on the work. And he got an assist from the chef David Chang, the don of the beloved Momofuku empire, whom he met while both were acting on Treme.

“He explained that when he started Momofuku, all he set out to do was make the best bowl of ramen that he could,” Ransone says. “And that money and fame and the adoration of his peers and the envy of his competitors and sex — it didn’t matter because focusing on those things would just prevent him from making the best bowl of ramen that he could.

“All I can do when I go home at night and lay in bed is think — when I was at work today, was it the best that I could have done? That’s the only experience I’m afforded. Everything else is not in my control.”

Then he started to say yes. To everything. To Spike Lee movies and teen slashers. To Off-Broadway plays and his friend’s short films. It put “the gas in the engine.” One night, at a 24-hour emergency veterinarian’s in Chelsea, he was approached by a young man with tousled hair who said he was a director.

“His dog Sunny had been hit by a car and my dog Boonee had an eye infection,” Sean Baker says now. “Perhaps I was being overdramatic. But at the end of the night, I told him I was a fan of his work.” Ransone stayed in touch with Baker — the stranger who’d approached Ransone at the vet’s office. Eventually, Baker put Ransone in his 2012 movie Starlet. As part of the ensemble, Ransone won the Robert Altman Award at the Independent Spirit Awards.

When Baker came back with the offer for Tangerine, Ransone didn’t hesitate.

Tangerine is now an important, critically lauded film not because of any calculated moral crusading, but because of a complete absence of it. Baker never set out to make a statement; he set out to make a comedy. The solution for the thorny question of representation is not always complicated. Treat people like people.

♦♦♦

Fifteen years in the game, and Ransone still doesn’t feel like a part of the industry. At his agent’s office, he imagines the other actors “must think I’m here to pick up their dry cleaning. ‘Oh, did you drop off the juice? Did you make sure the coconut water is in the Sub-Zeros?’” It’s a simple defense mechanism: They can’t kick you out of the club if you never belonged to it in the first place.

But there are some things happening right now about which Ransone has to feel cautiously optimistic. In a Valley of Violence promises twisted vengeance and John Travolta with a wooden leg, and might yet prove irresistible. Sinister 2, the latest strike from the ever-profitable Blumhouse horror empire, will open on over 3,000 screens, and no one ever said starring in a hit was a bad thing. And if our world were truly meritorious, Tangerine would be our latest indie-festival breakout.

For now, he’s still grinding. In a few months he’ll be in Berlin staging a live performance with the rabble-rousing artist Paul McCarthy; it’ll involve sitting for a full-body cast for a “corpse-like version” of his own naked body. He’s still saying yes to nearly everything that’s offered. He’s still going on auditions and feeling the never-ending sting of rejection.

“It’s been like a weird trip having a bunch of stuff come out all at once, and having people be interested,” he says. “But that’ll go away, too. They’ll stop paying attention to me in several months. And maybe, if I’m lucky enough to keep working, they’ll come back around again.”

And then eventually, maybe, everyone will know what David Simon knew about Ransone when he hired him, way back when, setting everything else in motion. “No, James is not playing himself,” Simon says. “He is acting his ass off.”