The cast of Star Trek Beyond have defended the decision to make Hikaru Sulu, helmsman of the USS Enterprise, gay in the franchise's latest film.

In the film, Sulu is seen raising a daughter with his same-sex partner. John Cho, who plays Sulu in Beyond, said that the decision to make the character gay was a nod to George Takei, who played the character in the original NBC series and came out gay in 2005.

Takei told The Hollywood Reporter that he had encouraged the cast and crew of the film to “create a character who has a history of being gay, rather than Sulu, who has been straight all this time, suddenly being revealed as being closeted” and called the decision “unfortunate.”

“George's Sulu is absolutely safe,” Simon Pegg, who stars in the film and co-wrote the script told the AP. “But for us it felt like it was a good way to address the idea of an LGBT character without it being like, 'And here's such and such; and they're five-foot-ten; and they do this job; and this is their sexuality.' It was like we already knew him. It was just something we didn't know about him. And that felt like a nice way to do it.”

Director Justin Lin said that he was proud of the story detail.

“I'm proud of what we've done,” Lin said. “You know, it's really not an issue. And it was not an issue for me personally.”

“But a lot times with sci-fi movies and Star Trek, I think it's our job to really put that mirror for us as a society. And whatever reaction, positive, negative, it's discourse. And I think that's always good,” he added.

Karl Urban, who plays Dr. Leonard “Bones” McCoy in the film, said that the decision to reveal Sulu's sexuality was rewarding in that there was a “whole generation of young people who are really happy to be represented.”