Updated

Gene Wilder may have captivated audiences as the title character in 1971’s “Willy Wonka & the Chocolate Factory,” but the star allegedly didn’t always feel the beloved story’s magic on set.

Brian Scott Mednick, who previously published a biography on the Hollywood icon titled “Gene Wilder: Funny and Sad,” recently told Woman’s World the actor clashed with the film’s director at times.

JOHN STAMOS AND 'WEIRD AL' YANKOVIC TO STAR IN 'WILLY WONKA'

“I interviewed Mel Stuart, the director of ‘Willy Wonka,’ for the book, and he just raved about Gene and about how much the kids all loved him,” said Mednick, who spent a reported 15 years researching and writing his book.

“But Gene called Stuart a maniac who yelled at everyone — not him — and thought that created an unpleasant environment on the set," he added.

“Willy Wonka” tells the story of a boy named Charlie (Peter Ostrum) who received a golden ticket to a factory where adventures and plenty of candy await him.

Reuters Gene Wilder 2

Actor and author Gene Wilder poses as he autographs his new book "The Woman Who Wouldn't" during a book signing session in New York March 26, 2008. (Reuters)

The film became a classic that further established Wilder as a revered American comic. However, Mednick insisted Wilder was worried the film’s lasting success would overshadow his extensive body of work.

“He gave an interview once where he said he did not want his gravestone to say, ‘Here lies Willy Wonka,’ yet ironically he did not have much choice about his legacy,” said Mednick. “When he died, all the news outlets highlighted his role as Willy Wonka above everything else. Gene wanted to be most remembered for [1974’s] ‘Young Frankenstein.’”

That comedic black-and-white film, which paid tribute to the look of Boris Karloff’s 1931 horror flick “Frankenstein,” explored how the American grandson of the infamous scientist struggled to prove that his grandfather wasn’t as insane as people believed. He is then invited to Transylvania where he discovers the process of reanimating a dead body with hilarious results.

Wilder wrote the screenplay and collaborator Mel Brooks directed.

Brooks originally described Wilder’s vision for “Young Frankenstein” as “cute,” but both men would garner Oscar nominations for their screenplay.

Reuters Mel Brooks Anne Bancroft

Mel Brooks and his wife Anne Bancroft. (Reuters)

Brooks and Wilder would work on three films together. Mednick said there was talks of a fourth collaboration, a black and white comic version of “Dr. Jekyll & Mr. Hyde.” However, the idea never came to light.

“The 'Jekyll & Hyde' project was just an idea they had tossed around,” he claimed. “I don’t think it ever had any realistic chance of getting made. The truth was that Mel was really enjoying acting in his own films and Gene had just started writing and directing his own films, so the professional relationship just grew apart, but they always remained very close friends until the very end. They spoke on the phone all the time, and Mel and [wife] Anne [Bancroft] were even known to spend the night with Gene and [his wife] Karen in Connecticut.”

Mednick said that, like Brooks, anyone who worked with Wilder over the years instantly admired the funnyman.

“There was the constant theme among everyone I interviewed,” he explained. “It got to the point that I was wishing for one person to call him a jerk and say that he poisoned pigeons in the park or something. I mean, I wanted to sell some books here! But his colleagues found working with him to be among the highlights of their career.

"Everyone spoke so highly of him, even people he never met. I was speaking on the phone with Jerry Lewis about 16 years ago about something totally unrelated to my book, and he knew I was writing it and said he had ‘such high regard’ for Gene Wilder and regretted that they never met.”

Wilder kept busy over the years pursuing his passion as an actor. His last credited role was that of Mr. Stein in the sitcom “Will & Grace” from 2002 until 2003, when he retired.

Reuters Gene Wilder 1

Gene Wilder (L) performs alongside compatriot Rolf Saxon, during the rehearsal of a scene from Neil Simon's "Laughter on the 23rd Floor" in New York, October 2, 1996. (Reuters)

“He always said if the right script came along he would do it, but he said everything he was being offered was filled with foul language and special effects,” said Mednick.

However, Wilder happily enjoyed his marriage to Karen Webb, a sign language expert who coached him for his role in 1989’s “See No Evil, Hear No Evil.”

The couple married in September 1991, which was two and a half years after Wilder’s third wife, comedienne Gilda Radner, passed away in 1989 from ovarian cancer.

The pair stayed together until Wilder’s death in 2016 at age 83.

People Gene Wilder

Gene Wilder and Karen Webb. (AP)

“Gene called Karen the great love of his life,” said Mednick. “It was his fourth marriage and the longest; he died shortly before their 25th wedding anniversary. Gene admitted he was very unhappy for a long time with Gilda. He didn’t think he’d get married again, and he said he didn’t believe in fate.

"And he nearly cried when telling an interviewer how passionate his love for Karen was. He said he always felt you make your life and then call it fate, but Karen made him believe in fate. Like any marriage, it wasn’t without its problems, but it was a very strong, loving marriage. He just idolized her.”

Wilder passed away in his Connecticut home from complications arising from Alzheimer’s disease. Former model/actress Kelly Le Brock, who co-starred opposite Wilder in 1984’s “The Woman in Red,” told Fox News in September 2017 she was devastated by the news.

“I loved the man,” she said. “I didn’t realize how much I loved him until he passed on. We had emailed a few times and then I saw him on an airplane a year before he died. But when he died, I cried for three to four days. He was my father in film. He guided me through my first film. It was such an extraordinary experience to work with him.”

89cdbf94-

Kelly Le Brock and Gene Wilder. (Orion Pictures)