The character is Montgomery "Scotty" Scott—chief engineer, miracle worker, and the man who "can't change the laws of physics." Two actors have defined him across two timelines.
The original. Doohan, a Canadian WWII veteran (lost a finger on D-Day), brought a working-class Scottish burr and weary competence to the role. His Scotty wasn't just a tech wizard—he was the ship's conscience, the voice cautioning Kirk against hubris. Doohan reprised the role in seven films and a poignant Next Generation cameo ("Relics," 1992), where an 80-year-old Scotty, suspended in a transporter buffer for 75 years, meets the Enterprise-D crew.
Pegg, a lifelong Trek fan, approached the role with reverence and wit. His Scotty is younger, more comedic, more openly exasperated by Kirk's recklessness—but equally brilliant. Pegg co-wrote Star Trek Beyond (2016), giving Scotty a central role and a love interest (Jaylah). He's voiced the character in games and shorts, fully owning the legacy.
Both actors understood: Scotty is the heart of the Enterprise. The warp core is metal; Scotty makes it alive. Whether Doohan's "She canna take much more, Captain!" or Pegg's "I'm givin' her all she's got!"—the line works because the actor believes the ship is her.