Most child actors don’t thrive in Hollywood past puberty. Cole Sprouse opted out on his own terms. The 2005 hit Disney Channel sitcom “The Suite Life of Zack & Cody” turned Cole and his twin brother, Dylan, into the Mary-Kate and Ashley Olsen of their generation. But after the series and its spinoff wrapped, Cole was ready for something new.

In 2011, Sprouse enrolled as a freshman at NYU. Over the next four years, he regained his anonymity, took photography classes, majored in archaeology and landed an entry-level job at a small laboratory in Brooklyn. “I was bagging artifacts,” says Sprouse, who is now 27. “And I got a call from my manager, who begged me to come back and audition for pilot season.” Sprouse made a deal. “If I don’t book anything, then I’m not going to do this anymore,” he recalls telling his manager. “And I gave her my word that if I did book something, I’d see it through. I booked ‘Riverdale,’ and it ended up tugging me back.”

Sprouse tells this story between cigarette breaks while sitting on the “Riverdale” set in Vancouver. The show, a fantastical teen soap based on “Archie Comics,” became an instant hit for The CW Network when it debuted in the winter of 2017. Sprouse’s role as the sardonic narrator Jughead — traditionally seen with his trademark crown-shaped beanie — has allowed him to reinvent himself as an actor in his 20s. This year, he starred in his first grown-up film, “Five Feet Apart,” as a man with cystic fibrosis who falls in love with a patient down the hall. The drama, distributed by CBS Films in March, became a sleeper hit, grossing almost $46 million at the domestic box office.

“It’s very difficult to make the jump from Disney child star to serious leading man in Hollywood,” says Justin Baldoni, the director of “Five Feet Apart.”

Sprouse spent the first 18 years of his life acting, guided by other people’s decisions. “My mother and father divorced at a young age,” he says. “I never knew them to be together. Our mother was really the main fuel for us to pursue acting. We booked a diaper commercial, and that got the ball rolling.” One of his earliest professional memories is from the ABC sitcom “Grace Under Fire,” where he shared the role of the family’s infant son with his brother. “Oh, we were exploiting child labor laws,” Sprouse says with a smirk. Having two identical boys meant that they could collectively work a full day, by splitting the job in half.

That was an arrangement they used often — although sometimes they’d take roles on their own (such as when Cole portrayed Ross’ son on “Friends”). Their big break was getting cast together in the 1999 comedy “Big Daddy,” playing an abandoned kid adopted by a boorish bachelor in the form of Adam Sandler. Sprouse recalls how one night during the shoot, a fire alarm went off in the hotel the cast was staying at in New York. “Adam Sandler carried me on his shoulder down 45 flights of stairs, which was really cute,” he says. “We were taught every single bad word. So when my brother and I went back to school, we swore like sailors.”

Most of the time, they were homeschooled. “I don’t feel like I missed out on the United States public high school education,” Sprouse says. “My brother and I both have ADHD, and I needed one-on-one attention from a tutor.” Getting their own sitcom on Disney Channel made their careers explode. “It was the golden ticket,” Sprouse says. “At the time, being the leads of a sitcom as kids was the most stable job we could think about in the industry. In terms of technical acting, it’s only 30 minutes long. My brother and I were really thankful for it.”

They were able to avoid the scandals that consume other Disney stars because of their strong family network. “Cole and I had each other,” Dylan says. “We were blessed to have someone experiencing the same thing at the same time, as an objectivity to the reality of it all.” Dylan recalls one day, as a teenager, getting into a drag-out fistfight with his brother between takes — it was broken up when a fan asked them for a photo backstage. “It was such a weird and funny moment that we actually calmed down, laughing at each other.”

They spent six years at Disney, with three seasons on “The Suite Life of Zack & Cody” and another three on the spinoff, “The Suite Life on Deck.” Despite an offer to do a third series with Disney, Cole and Dylan knew they wanted to attend college, and both were accepted to NYU. Still, it took some adjustment. “The amount of rumors that were spread about Dylan and I were incredible,” says Cole, who heard stories about how he’d fallen down the stairs at the school library. “When you’re a public figure, people use you to build their identities. And I think that was a bit daunting. But also because I’d been homeschooled, I had no idea what it was like to interact with other people socially.”

Sprouse has always been an avid pop culture fan. As a teenager, he attended conventions dressed as Link from “The Legend of Zelda” or the wizard from Hayao Miyazaki’s “Howl’s Moving Castle.” He deferred NYU for a year to work behind the counter at Meltdown Comics, a Hollywood landmark that’s since shut down. Last month, while attending Comic-Con for a cast discussion about “Riverdale,” Sprouse wanted to browse the floor. “Cole put on a scarecrow mask,” recalls “Riverdale” showrunner Roberto Aguirre-Sacasa. “And he was walking around. The thing that was shocking: Even wearing the mask, people were like, ‘Oh, my God! That’s Cole!’ I was like, if he takes it off, he will get trampled.”

“I booked ‘Riverdale,’ and it ended up pulling me back.”

Cole Sprouse

On “Riverdale,” Sprouse was invited to audition for the role of the lead, Archie. He instead asked for the outcast part. “I said this is a little bit more my style,” Sprouse says. “And I just kind of read it like Rod Serling,” he says, referring to the narrator of “The Twilight Zone.” Initially, Jughead was supposed to be a marginal presence. But when producers saw Sprouse’s interpretation — “almost like an actor doing a Harold Pinter play,” remembers Aguirre-Sacasa — they broadened his role. In the second episode, Jughead joins Archie (K.J. Apa) and his inner circle, sipping milkshakes at the diner with Betty (Lili Reinhart) and Veronica (Camila Mendes). His flavor of choice? “Coffee, which just gets me amped.”

Like most shows targeted to teens, “Riverdale” has been a roller coaster for both its cast and its fans. Recently, there have been reports that Sprouse broke up with Reinhart, his on-screen love interest who was also his real-life girlfriend. (He took to Instagram after our interview with a coy post that mocked the headlines.) The show’s third season had plot twists too incomprehensible to describe, involving a cult called the Farm (led by Chad Michael Murray) playing a murderous game similar to Dungeons & Dragons. And there was a cliffhanger that suggested that Jughead’s days might be numbered. “I couldn’t tell you,” says Sprouse, who isn’t given the scripts ahead of time. “To be honest, I think there could be a Riverdale without every single one of our characters. And then we’ll appear as ghosts, or our twins will take our place.”

But Sprouse isn’t in a hurry to graduate from “Riverdale.” He says the show has given him a renewed appreciation for acting, one he couldn’t have when he was younger, because he was so focused on being his family’s breadwinner.

“I’m somewhat of a workaholic,” Sprouse says. “Maybe that’s my child-star brain, where I just can’t stop thinking about being a commodity.”

On the day of our set visit, the four “Riverdale” actors are shooting at a house on the outskirts of Vancouver that’s been converted into an ominous location. This episode, which will air in the fall, is a tribute to Luke Perry, who played Archie’s dad and died in March at the age of 52 from a stroke. Sprouse has talked about what Perry meant to him, and how his passing affected him deeply. Between takes, the actors are mostly quiet.

Sprouse says that these scenes — which involve Jughead helping Archie say goodbye to his father — have required some thought. “The important line we’ve all been trying to draw is how to separate, how we can portray real emotions, but in the eyes of the characters,” he says. “If I was making this an entire sob story about my relationship with Luke, it wouldn’t be a job well done. My job is to do it in the eyes of Jughead.” And he doesn’t think Perry would approve of tears. “Luke was the kind of guy who would not like people crying about him,” Sprouse says. “I hope this episode does him justice, but I think the way we lived with him does him justice as well.”

Dylan thinks that Cole could become “a great cinematographer or director.” When he’s not acting, Cole sidelines as a professional photographer, shooting spreads for magazines and fashion brands like Moncler, which sent him to Iceland for a campaign. “Most of the people that I speak to initially don’t know him from his acting,” says his photography agent, Glenn Wassall, who represents Annie Leibovitz. He describes Sprouse’s aesthetic as “fashion within landscape,” as in a portrait of a woman bundled in a glamorous coat against a backdrop of ice-covered mountains.

Cole could see himself working again with Dylan, who has also gone back to acting, with an indie film, “Tyger Tyger,” out next year. “We’ve talked about it,” Cole says, adding that it wouldn’t be a reboot or a reunion for Disney. “The whole kitschy twin thing, I don’t think that really sells anymore.” He explains what would convince them: “It’s about feeling passionate for acting again. If it’s a cool project, I don’t have a problem with that.”