From sword fighting with an angry Cornish separatist to having his nether regions attacked by a swan, there isn't much Jack Whitehall won't do to raise a laugh in his new film.

But one scene in The Bad Education Movie, the big-screen version of the comedian's popular BBC Three comedy series - which sees hapless teacher Alfie Wickers (Whitehall) take his pupils on a school trip to Cornwall - was more blush-inducing than the rest.

On a visit to the Eden Project, one unruly student decides to pull Alfie's trousers down before pushing him down the attraction's zip wire - the longest in England.

"It's a British film, we didn't have enough money to close down the Eden Project, so there were a load of tourists there," says Whitehall, who was supplied with a "very small, pink modesty sock" to film the shots.

"On one of the runs down, the wind changed and I was caught in the middle of the zip wire, dangling like Boris Johnson [who famously got stuck on a zip wire back in 2012], but I had my pants around my ankles. All these Japanese tourists and school parties on viewing platforms had their camera phones out, taking photos. I felt quite vulnerable."

Whitehall is quick to add that "it's not all nudity and bums" in the film. "T here is some smart humour in there as well," he notes. "Hidden somewhere..."

The 27-year-old starred in and co-wrote (with his school friend Freddy Syborn) three series of Bad Education before the show wrapped last October. The sitcom, which debuted in 2012, broke BBC Three's record for the highest-rated first episode of a comedy and earned itself legions of young fans.

The film version sees Alfie whisk his pupils off on a post-GCSE trip, which, as can be expected from the loveable but irresponsible history teacher, ends up in chaos.

There are a fair few jokes about Cornish politics (Whitehall has jokingly described it as "Cornwall's Braveheart"), pasties, clotted cream and even inbreeding, but the comic insists that local people shouldn't be offended.

"I think the Cornish are good at laughing at themselves. And I think it's all done good-naturedly," he says.

"Although I do worry that, deep down, this may undo all the good work done by [recent BBC period drama] Poldark to attract people to the county. There's no topless scything; it tends to dwell more on the eccentric side."

He admits that putting his work up on the big screen for a public critique is "really scary".

"You've just got to make sure that you don't make the mistakes that maybe people have made before [with film adaptations]. We were really careful, when we were writing it, to make sure that it was a stand alone film. You didn't need to have seen the TV series to enjoy it."

The star, who is dating Gemma Chan, star of recent Channel 4 hit Humans, adds: "We really have supersized it for the film and thrown everything at the wall: we've got explosions, special effects, a helicopter manhunt, battle sequences, a sword fight. It's got everything. And a swan; that swan."

As with the TV version, which featured up-to-the-minute youth speak and cultural references, Whitehall was keen to keep the film current.

"I take a lot of advice from the kids on the show on what the 'yoot' are saying. I often show them the scripts," he says.

"There's nothing worse than a 27-year-old posh boy trying to write young lingo."

The son of actress Hilary and talent agent Michael, who appeared alongside his son in the BBC comedy talk show Backchat, Whitehall was educated at Marlborough College - where Kate and Pippa Middleton were also pupils.

He enrolled to study history of art at Manchester University, but soon realised it wasn't for him, and performed stand-up shows in the evenings.

At the age of 19, he landed a presenting stint on Big Brother's Big Mouth, followed by panel show appearances and an acting role in E4's university comedy Fresh Meat, playing posh student JP, before Bad Education came onto the scene.

What does his father, whose clients have included Dame Judi Dench, Richard E. Grant and Colin Firth, make of his latest venture?

"He saw the trailer and went, 'Well, this doesn't look very subtle'. He also was in the film. He was going to be an extra in one of the scenes, he was going to play a priest. He came all the way down to Cornwall and he'd worked out a whole backstory about his character," says Whitehall.

"My mum drove him down, he got the whole costume and everything and then he did his bit just sort of standing in the background. And that shot has now been cut, so he's not even in the film. Which he doesn't know. He's coming to the premiere. It's going to be quite awkward afterwards..."

Whitehall has said he's keen to do more of "this acting lark", but he's keeping his cards close to his chest about future projects.

"Either this will open doors or be a nail into the coffin of my acting career," he says. "But either way, it should be quite a fun way to go out."

:: The Bad Education Movie is released on Friday, August 21