LOS ANGELES — Patty Duke is playing twins on TV again, this time as a pair of grandmas on the Disney Channel.

The 67-year-old actress will guest star on an upcoming episode of “Liv and Maddie,” which follows twin sisters played by actress Dove Cameron. The episode will air next year.

Duke said her grandchildren are fans of the show, and while she never expected to play twins again, she felt a twinge of jealousy when she saw Cameron doing it.

“I won’t lie,” Duke said. “When (the show) came on the air, there was a part of me that said, ‘I want to do that!”‘

Duke famously played “identical cousins” on her namesake sitcom that aired in the early 1960s.

Producers of “Liv and Maddie” said they were inspired by Duke’s show and long hoped she’d appear on theirs. Cameron studied all three seasons of “The Patty Duke Show” to prepare for her roles as twins, and said she cried when she learned she’d be working with Duke.

Duke said it was initially tough playing twins again, especially because one of her characters is pretending to be the other. But with Cameron and the writers’ help, she found her groove.

Shooting twins for TV hasn’t changed much in the 50 years since Duke’s show ran, the actresses said. They still use body doubles and static sets, shooting everything twice so the actress can portray each twin. Only there are four cameras on “Liv and Maddie,” compared to just one when Duke’s show was shot.