It's a hairy moment for Lt. Cmdr. Montgomery "Scotty" Scott: The crew of the Starship Enterprise has crashed on an unknown, unfriendly planet, and the spacecraft's chief engineer, separated from Kirk and Spock and the rest of the gang, is dangling from a cliff, an abyss below.

We never get to see how Scotty extricates himself from the situation, but - no spoiler here - he does.

"Sheer forearm strength," says Simon Pegg, explaining how the Starfleet engineer from Aberdeen hoists himself from the precipice. "Scotty probably did the caber toss in the Highland Games, and as such has really strong arms."

Pegg should know. In addition to reprising his role as Scotty, reteaming with Chris Pine's Capt. James T. Kirk, Zachary Quinto's Cmdr. Spock, and company for the second sequel in the revivified series, the English multitasker cowrote the screenplay for Star Trek Beyond, the third installment in J.J. Abrams' reboot of the beloved TV and film franchise.

It is easily the most democratized of all of the Trek movies - the six old ones with William Shatner and Leonard Nimoy (and James Doohan as Scotty), and the three new ones, too.

McCoy, the chief medical officer played by Karl Urban, is in on the action. So too Uhura, the communications officer portrayed by Zoe Saldana. And helmsman Sulu, played by John Cho. And navigator Chekov, played - sadly for the last time - by 27-year-old Anton Yelchin, who died in a freakish driveway accident last month.

(About Yelchin, Pegg offers: "It's hard to talk about, and we're all obviously heartbroken. I can only say that he's missed and loved, and that we're devastated.")

"We wanted to create an ensemble with this one," Pegg says, on his communicator from Los Angeles the other day. "The first two films very much centered around the relationship between Kirk and Spock, which is an iconic and worthy relationship to focus on, but we felt like it would be repeating ourselves to do it again.

"Also, it's a very famous ensemble. When you think about the crew of the Starship Enterprise, they are all distinctive, clearly defined. . . . We liked the idea of representing them in a more even way, but also pairing them off in combinations that you might not have seen before."

As for Pegg, he gets paired with the newcomer Jaylah, a kickboxing alien warrior with a black-and-white face and ribbed hair played by athletic Algerian Kingsman actress Sofia Boutella.

Typically, Scotty can be found down in the engine room, or the transporter room, feverishly working the controls. In Beyond, he does quite a bit of dashing around - but not as much as the new movie's poster might suggest.

"It's funny, actually, because on the one-sheet for the film, I'm holding a phaser, but at no point in the film do I pick up a phaser," Pegg says. "You know, Scotty has the wherewithal to escape in a photon torpedo tube, which was a little nod to The Search for Spock and The Wrath of Khan, but having pulled himself off of that cliff, generally speaking, he's back to his ordinary sort of working the transporters and doing the technical stuff. . . . I do get a little flourish in the midst of that incredible action sequence, but then how could you not?"

The incredible action sequence Pegg is referring to comes by way of Star Trek Beyond's director, Justin Lin, who brings his Fast & Furious aesthetic to the Trek series' 23rd century. Pine even rides a motocross bike around a rock quarry. And Boutella's Jaylah, a brooding intergalactic castaway, has her MMA moves down.

"Sofia is such a game performer," Pegg says. "She had to wake up for makeup at 2 o'clock in the morning sometimes, and she's a physical actor, as well, so she handled all of the fight scenes. She's a dancer, so she's absolutely brilliant at all that sort of stuff. . . . I like the idea of Scotty meeting a younger version of himself, really, as a female. Someone who is adept at fixing stuff. I felt that was a good dynamic."

Of course, Scotty insists on calling Jaylah "lassie." No wonder she keeps giving him dirty looks.

"We wanted it to appear like Scotty was from a different generation, and, obviously, his Scottishness comes into play there," Pegg explains. "That's a very Scottish thing - referring to younger people as laddie and lassie. . . . And also it made Scotty seem a little bit old-fashioned, which was nice. It threw Jaylah's youth and exuberance into sharp relief, with Scotty as this slightly avuncular, almost behind-the-times kind of guy."

Pegg, the whipsnapping Brit who collaborated with Nick Frost and Edgar Wright on an inspired trilogy of genre send-ups - Shaun of the Dead, Hot Fuzz, and The World's End - as an old-fashioned, avuncular, behind-the-times guy?

"Well, you know, 'time and tide,' man. It happens. I'm 46. I'm not the young buck anymore. I'm not sure I ever was."

Last week - before Star Trek Beyond opened in theaters on Friday - Paramount announced that a fourth installment in the franchise was being readied, with Chris Hemsworth reprising his role from 2009's Star Trek as George Kirk, Capt. Kirk's dad. If the sixth Mission: Impossible gets underway next year as expected, with Pegg as Benji Dunn, Tom Cruise's techie sidekick, the English actor will have plenty to keep him busy.

In addition to those two kazillion-dollar tent poles, Pegg appeared, CG-ed as the Jakku junkyard dealer Unkar Plutt, in Star Wars: The Force Awakens. The one degree of separation in the three series? Abrams, rebooter extraordinaire, oversees them all.

"It's because of J.J. I'm in Mission and it's because of J.J. I'm in Star Trek and also Star Wars," Pegg says. "He's someone I get on so well with and share so many interests and ideas with. . . . And it's not like he's doing me favors. I feel like he trusts me."

Asked how he thinks Star Trek's Scotty would have voted on the Scottish independence referendum, or, for that matter, Brexit, Pegg was quick to respond:

"I think Scotty absolutely would have voted to stay together, and I think Scotty would have voted to remain in the European Union. . . . Scotty, as a dyed-in-the-wool Federation boy, would always be a Remainer," he says with a chuckle.

"The point of the Trek future is that we are a unit, we are advocating collectivism at all times and believe very strongly that we're better together," says Pegg, well aware that Star Trek has always traded in social and political allegory. "Whether that's as the United Kingdom, or the European Union, or the Federation [Star Trek's United Federation of Planets] - it's about the benefits of working together and putting aside our differences and our intolerances and our prejudices and actually understanding that the only way forward, really, is unity, not separatism."