Luke Wilson dishes on playing a superhero in ‘Stargirl’

Luke Wilson has done nearly everything in Hollywood except play a superhero — but with his role in “DC’s Stargirl,” he can now cross that off the list.

“I’ve played a police officer, I’ve played a lawyer, I’ve done a few Westerns,” Wilson, 48, tells The Post. “I feel like I’ve gotten to do every movie I’d grown up thinking was cool — but I’ve never done any kind of superhero project.

“That was appealing to me, 25 years into [my career],” he says, “to get to do something different.”

Premiering Monday on the streaming platform — DC Universe — and airing the following day on The CW (8 p.m.) — “DC’s Stargirl” is based on the comic of the same name. It follows teen girl Courtney Whitmore (Brec Bassinger, “All Night”), who discovers a magic staff that soon throws her into a world of intrigue. Wilson plays her caring stepfather, Pat Dugan, a mechanic who’s secretly a retired superhero sidekick (his alter-ego name is STRIPE).

Wilson, known for quirky comedies such as “The Royal Tenenbaums” and “Old School,” says he didn’t read many comics during his childhood in Texas, since his tastes veered more towards Mad Magazine. But when creator Geoff Johns (“Wonder Woman 1984”) pitched him the role in “DC’s Stargirl” over lunch, the two hit it off.

Brec Bassinger in “DC’s Stargirl.”The CW

“I just always appreciate those people who are experts in their own field,” he says. “Whether it’s somebody that knows everything about the Yankees or about fly fishing … Geoff is one of those people who’s so knowledgeable about comic books. We were laughing about our early days in Hollywood. We had similar experiences where he worked as [director] Richard Donner’s assistant, and me and my brothers [Owen and Andrew] and Wes Anderson were working for [director] James L. Brooks.

“We just got along personally, right from the get-go.”

Aside from bonding with the show’s creator, Wilson says he was also drawn to the warmth and optimism in “DC’s Stargirl.” Unlike some of TV’s edgier superhero fare such as “Watchmen” or “Legion,” it’s geared towards family audiences.

“You know what it’s like in Hollywood — they’ll say that about the ‘Saw’ movies just to get people in the seats. Great family movie!” he says, laughing. “But this really is. The idea that in households across America, people can be sitting together watching a new show — it’s something that my nephews and my niece could watch, as well as somebody my age — that’s exciting to me. I’m really proud of the show.”

It also marks a rare small-screen part for Wilson. Aside from appearances on “That ‘70s Show” and the short-lived Cameron Crowe Showtime series “Roadies” in 2016, his career has skewed more towards the big screen. He says he’s surprised by which roles have resonated in pop culture.

“I’ve had funny things happen — like [2006 movie ‘Idiocracy’] was barely released by the studio, I think it played in like seven theaters for a week. And it just really bums you out when you work hard on something and it feels like a failure,” he says. “Then, a couple years pass, and now I get asked about ‘Idiocracy’ as much as anything. You never know what will appeal to people.

“I’ve watched more TV than I should during this pandemic, and I’ve been like, ‘Boy, is it just me, or is ‘Legally Blonde’ on constantly?,’” he says. “That’s one of those movies, too, where I was happy to do it because I thought Reese [Witherspoon] was funny … but I’ve had moms come up and say, ‘This was my favorite movie when I was 12, and now I just showed it to my daughter.’

“I feel really lucky to have worked on [projects] that kind of became part of the social fabric.”