Mel Brooks had his work cut out for him when he decided to spoof "Star Wars."

The legendary comic is making his seventh appearance at the Turner Classic Movies (TCM) Film Festival to present his 1987 film "Spaceballs" on the festival's closing night at TCL Chinese Theatre. The 97-year-old will be joined by TCM host Ben Mankiewicz.

Brooks told Fox News Digital that the making of the film quickly racked up the bill, all thanks to one star.

WHY 'HONEY, I SHRUNK THE KIDS' STAR RICK MORANIS LEFT HOLLYWOOD

Rick Moranis sticking his tongue out next to Mel Brooks

"Rick Moranis cost me a lot of money," Mel Brooks, right, told Fox News Digital. (ALAMY)

"Rick Moranis cost me a lot of money," Brooks explained about the "Honey, I Shrunk the Kids" actor. "When we were filming, the whole crew kept laughing at his antics and ruining take after take!"

"It all started with his entrance in his giant helmet and the line, ‘I can’t breathe in this thing,'" Brooks recalled. "His reading of it was so real and funny that everybody on the set exploded with laughter! I had to sternly caution the crew not to break up when Rick did his stuff, but it was hard because often I’d be the guilty one laughing my head off."

"Spaceballs" tells the tale of an alien princess, played by Daphne Zuniga, who is rescued by a space mercenary, played by Bill Pullman, from an evil ruler, played by Brooks, and his hatchet man, Dark Helmet, played by Moranis.

Bill Pullman embracing his female co-star and leading lady

"Spaceballs" stars Daphne Zuniga and Bill Pullman. (ALAMY)

George Lucas famously allowed his Industrial Light & Magic to do the special effects and even loaned Brooks the Millennium Falcon for a cameo.

Brooks, an EGOT winner, admitted that Moranis was not the only one who left him in stitches on set.

"After Eagle 5, our flying Winnebago, crash-landed… John Candy came up with a great line," Brooks explained. "Candy, gingerly unfastening his seatbelt, ad-libbed, ‘Oh! That’s gonna leave a mark.’ It was so unexpected and better than anything we had written for that moment."

CLICK HERE TO SIGN UP FOR THE ENTERTAINMENT NEWSLETTER

John Candy dressed in character for Spaceballs

John Candy played "Barf" in "Spaceballs." (ALAMY)

"I think that day on set was when I truly realized how lucky I was to have John Candy in the cast," he reflected. "And… not to mention his sweet and wonderful personality, he was a joy to work with."

Candy died in 1994 at the age of 43 from a heart attack in his sleep.

Brooks had already parodied classic genres like the Westerns with "Blazing Saddles," the horror films with "Young Frankenstein" (both 1974) and thrillers with "High Anxiety" (1977) when he took on the "Star Wars" franchise.

Rick Moranis in character as Dark Helmet in Spaceballs

Rick Moranis played Dark Helmet in "Spaceballs." (ALAMY)

"It was one of the only film genres that I hadn’t yet tackled!" said Brooks. "So going to outer space made for a whole lot of fun. ‘Star Wars’ was a great jumping-off point, but the genre of science fiction was a rich field for me to explore and give my comic spin to. And boy did I spin it."

Brooks is hopeful that a new generation of viewers will discover the cult class.

"It’s such a special joy at the TCM Film Festival to see the films that we loved back on the big screen," he gushed. "I’m a big fan of TCM, I think they do a great and important job. Somebody has to preserve our cinematic history and look after our classic films."

CLICK HERE TO GET THE FOX NEWS APP

Mel Brooks holding his Oscar

Mel Brooks poses with his Academy Honorary Award during the Academy of Motion Picture Arts and Sciences 14th Annual Governors Awards at the Ray Dolby Ballroom in Los Angeles on Jan. 9, 2024. (ROBYN BECK/AFP via Getty Images)

Looking back at his decadeslong career, Brooks said the secret to making good comedy is surprisingly simple.

"The secret is that if something is funny, you as the filmmaker have to be the first one to genuinely laugh," Brooks explained. "Don’t write what you think people may find funny, write something that made you really fall down laughing."

LIKE WHAT YOU’RE READING? CLICK HERE FOR MORE ENTERTAINMENT NEWS

"More than anything, as a performer I love being on stage and getting a big laugh from a live crowd," Brooks continued. "Near the end of some of my shows, we’d take questions from the audience. One of the questions was a little personal. They asked, ‘What do you wear —boxers or briefs?’ When I answered, ‘Depends!’ you had never heard a such roar of laughter. It nearly blew me off the stage. Moments like that make it all worthwhile."