Making Lt. Hikaru Sulu (John Cho) gay in Star Trek Beyond — the first clearly LGBT main character in Trek's 50-year history — recently became somewhat controversial after George Takei, who originated the role, called the decision "really unfortunate." But when they were writing the script, Doug Jung and Simon Pegg were concerned about sparking a different kind of controversy around the character. "We really were trying to make sure that no one thought it was something that happened that made him gay," Pegg told BuzzFeed News in mid-July.

The screenwriters wanted to certify the character's sexuality as a fact and not some kind of Trek-ian anomaly, while also integrating him into the larger fabric of the Trek universe. So, they decided to give him a family. "It felt like we'd [said], like, 'Oh, here's Commodore Paris, she's the head of Yorktown and she also is a lesbian,' it would have just felt a little bit like, 'Here's the [gay] character! Look, aren't we clever!'" said Pegg.

What Pegg and Jung did not realize at the time they were writing Sulu's storyline was that the latter would have an even more integral role: Doug Jung wound up playing Sulu's husband.

"It was very off the cuff," Jung told BuzzFeed News in mid-July. Director Justin Lin had planned to shoot the character's scenes in the gleaming, modern cityscape of Dubai, which stood in for Star Trek Beyond's vast space station Yorktown. Initially, the production wanted to hire a local actor for the role. "It was one of those things that sounds like a minor thing, but it just ended up not being very easy," Jung said. An actor was eventually cast, but according to Jung, he dropped out the day before the scene was going to be shot.

Paramount Pictures

John Cho in Star Trek Beyond.

"Justin and Lindsey Weber, our producer, were kind of like, 'Why don't you just do it?'" Jung said with a laugh. "I was a little self-conscious — for my physical appearance. John's a good-looking guy! But I was thrilled to do it, because it was something we all really believed strongly in, and it was kind of nice to put your money where your mouth is."

Although the audience never learns the name of Sulu's husband, Jung said that his character was named "Ben" in the script. And in order to make sense of why Ben would be waiting for Sulu on a Federation outpost in deep space, the screenwriters did develop a small backstory for the character.

"Ben probably was a civilian," Jung said. "They had met probably on some leave, decided to have this child, and then he would have been coming to Yorktown as a full-time resident in order just to be closer to Sulu, who's venturing off into the unknown parts of space."

Placing Sulu's family on Yorktown also helped to increase the dramatic stakes for the film's third act, when Beyond's villain Krall (Idris Elba) threatens to destroy the entire outpost and everyone living on it. "There was a scene that I thought was really nice where Sulu expresses a level of guilt that because of his duties, [his husband and daughter] were put into this position where they're in jeopardy," said Jung. "We wrote it, but we never got to shoot it."

What the filmmakers never wrote into the script, however, was a kiss between Sulu and Ben, out of a desire to make their reunion as prosaic as possible. "It's funny, whenever I come home to my wife, I don't always immediately kiss her hello, either," Jung said. "At the airport, we sometimes hug, and there are the kids, and it sort of becomes about that. I think it was really important to represent this was a normal family reunion that happens without a lot of fanfare."

"I'm sure it's bittersweet for George, because it should have been him. It just should have been him," he said. "It was a disappointment that George didn't see it as the loving acknowledgment of him that it was, but I totally get it. We had long discussions about it over email. And I told him we were going to do it anyway, and he was like, 'Okay.' When it's come out in the media, they've amped it into slightly more of a spat than it really was. It was more like a friendly disagreement."

On this point, Takei concurred. "We did have an email discussion and agreed to disagree," the actor confirmed to BuzzFeed News via email. "It was friendly and I wished him and Star Trek well. Our disagreement was my love and respect for Gene Roddenberry. I emphasized that it wasn’t about honoring me or Sulu. … But all this hoo-haw will only contribute to the discussion and ultimate box office success of Star Trek Beyond. It's just a tempest in the galactic teapot."