Nick Robinson has opened up about his brother coming out as gay.

The actor, who previously starred in Jurassic World, plays the lead character in upcoming movie Love, Simon, which follows 17-year-old Simon Spier as he comes to terms with his sexuality by emailing an anonymous admirer at his school.

But while Nick plays a teen struggling with his sexuality in the movie, it was his brother who was navigating his way out of the closet in real life, as he revealed during an appearance on The Ellen Show this week.

“He came out around the same time we started filming, yeah. I think that he had been dealing with this for a long time and the timing was coincidental, but one of the best things that came out of this movie was being able to talk to him,” Nick said.

“I think that’s the strength of a film like this is that it starts conversations, and I hope it can do that for more people and start a conversation that might not have been there.”

Related: Watch Simon talk to his dad about being gay in emotional Love, Simon scene

Nick was also asked whether he, as a straight man, hesitated to play a gay character. It’s an issue that has seen heated debate over recent years, as many gay actors find they struggle to land straight roles.

“It was a conversation with Greg [Berlanti], our director, we went back and forth and we talked about it,” he said,

“But I really think that with a project like this, especially today, there’s been so much progress in the last 20 years, a lot of which is thanks to you and everything that you’ve done. If you hadn’t come out when you did we might not have this movie now.”

Watch a clip of the interview below.