Sure, 1986 was great, and 2015 was fun, too. But Judd Apatow embraced being a Mets fan even in the darkest days of the late 1970s — maybe more so then.

“The Mets were terrible for most of my childhood,” the 48-year-old producer/director/writer/actor/comedian said. “We waded through most of those eras — the George Foster Era, the Dave Kingman Era — and I used to love being at Shea Stadium when no one was there.

“I love being a fan of teams when they’re not good. That’s my favorite thing. Then when they win, it’s so exciting.”

The excitement of the ’86 championship team — and the stories of two of its troubled stars— now has become an ESPN “30 for 30” documentary on which Apatow codirected with Michael Bonfiglio. “Doc & Darryl” premieres July 14.

Apatow is well-positioned to help tell the tale of Dwight Gooden and Darryl Strawberry. He was born in Flushing, home of the Mets since 1964, and when he was 5 he moved to Syosset, where he spent his teenage years watching the team’s rise.

He graduated from Syosset High in 1985 and was at the University of Southern California when the Mets won it all.

advertisement | advertise on newsday

Living and working in the Los Angeles area for all these years has not altered his sports loyalties, though.

“No, no, I don’t go to Dodgers games,” he Wednesday night the New York premiere of “Doc & Darryl.” “There’s too much traffic getting there. If there was no traffic getting to a Dodgers game I might change allegiances.”

He was kidding, presumably.

Apatow said he was drawn to Gooden and Strawberry because he is “always interested in what the real story is.”

In the case of the Mets’ two young stars of the era, that story included well-documented substance abuse that altered what might have been Hall of Fame careers.

Mets videos

Apatow said the project grew darker as it went along, as the filmmakers realized this was not merely a tale of two aging athletes who had overcome problems. Some of those problems turned out to be strikingly recent.

In 2003, Strawberry was released from prison after serving 11 months for violating probation on cocaine possession charges.

In 2010, Gooden pleaded guilty to child endangerment after being charged with driving while intoxicated with a child passenger — his five-year-old son — and received five years probation and was ordered to undergo outpatient drug treatment.

“So it wasn’t just two guys who were on drugs a really long time ago talking about it,” Apatow said.

Bonfiglio handled the interviews. In fact, Apatow still has not met either of the featured subjects.

advertisement | advertise on newsday

“I think it’s better for me because my interviews would have been much different than his,” he said. “I would have gone to a much weirder place. He’s a much nicer person than me.”

The film centers on sit-down interviews with Gooden and Strawberry separately, framed by a conversation between the two in a Queens diner that is awkward at times in the film and according to Bonfiglio was even more awkward at times before being edited down.

The chat was inspired by a diner scene from the movie “Goodfellas” between actors Robert DeNiro and Ray Liotta. At first, the goal was to replicate that feel; then the filmmakers did one better, filming it in the same Queens diner as the one used in the 1990 movie.

Among many downers, one that stands out is Gooden’s decades-old regret over missing the 1986 Mets’ victory parade after a long night of drinking and drug abuse.

Said Apatow of the film’s dark tone, “We talked about being honest about what their experience has been and to not make it a rah-rah sports movie. That’s part of the story. I’m more interested in people and their humanity and their struggles and what it felt like to be on top of the world and what it felt like when that was over, how those guys continued to live their lives and the choices they make.

advertisement | advertise on newsday

“So it’s more of a character study than it is about this team. There are a thousand movies we could make about what happened with this team.”

For Mets fans of a certain age, that era and those players forever will inhabit a special place in memory.

“I remember the year when Darryl Strawberry came up (1983), and he was amazing,” Apatow said. “Then the next year Dwight Gooden came up and he was amazing, and everything started falling together.

“I was at one of the games where he had 16 strikeouts. That was probably one of the most exciting games I’ve ever been to, because every pitch felt like the last pitch of a game. The place just exploded with every throw.”

Apatow said it is no surprise that many comedians are drawn to the Mets, a list that includes Jerry Seinfeld, Chris Rock, Kevin James, Jimmy Kimmel, Jon Stewart, Bill Maher and Ray Romano, among others.

“Maybe it goes back to Casey Stengel,” he said. “There was always something comic and underdog about the team and I think comedians relate to underdogs, not to people of greatness. We like people who struggle.”

Apatow no longer has close family on Long Island, but he returns regularly. The day of the “Doc & Darryl” premiere he had been shooting on Sands Point for a new HBO series.

He said his Long Island childhood has been and remains a strong influence on his career.

“Oh, absolutely,” he said. “My high school experience was what I drew from when I was writing on ‘Freaks and Geeks’ and it was a great place to grow up. Everybody was really nice. We just wandered around. We were on bikes.

“School would end and from 3 o’clock to 7 o’clock our parents would have no idea where we were. We were just running around with zero supervision having a blast.”

Apatow has had little experience writing sports-related comedies, other than one called “Celtic Pride” in 1996. But he was a producer on both “Talladega Nights” and “Kicking and Screaming,” one about car racing and the other soccer.

“They’re difficult to do well,” he said. “But the characters in sports movies are fun. I think Will Ferrell’s Ricky Bobby (in ‘Talladega Nights’) is one of the great comic sports characters.”

Apatow said he always has been drawn to sports’ losers, from the late 1970s Mets through today.

“When I watch sports I can’t enjoy it that much because as soon as Cleveland wins [the NBA title] I just look at who lost and I feel bad for them,” he said. “So I don’t have any joy with any moment of anything because I just go, ‘Oh, Freddie Patek is crying on the bench [after the Royals lost the 1977 ALCS to the Yankees]!’

“Everybody is Karl Wallenda falling off the wire onto a cab for me.”