Garrett Clayton announced that he is gay on Instagram Monday.

The Teen Beach Movie and The Fosters actor opened up about his sexuality while discussing his upcoming movie Reach.

Get push notifications with news, features and more.

“I thought it was important to explain why I took on this project in the first place,” he wrote. “REACH deals with some very serious and timely topics that have affected me personally, and have likely influenced many of your lives as well.”

Clayton, 27, said he decided to take on the role because of the personal connections he and the “man I’ve been in a relationship with for a long time” have to the film. The actor tagged boyfriend Blake Knight in the post.

“I have personally dealt with suicide within my own family, intense bullying in high school, and – on top of it all – myself and the man I’ve been in a relationship with for a long time (@hrhblakeknight) have both experienced shootings within our hometown school systems, and have witnessed the heartache that takes place in affected communities after such tragic events,” he continued.

He said his goal in starring in the film was to help others who might be struggling with similar issues.

“These topics – not always easy to discuss- are all close to my heart, and, knowing how serious they are, I wanted to share this with you all,” he concluded. “This film has come from the perspectives of people who care deeply about these issues, and if watching it helps even one person… then it was all worth it.”

Reach follows teenager Steven Turano (Clayton) as he struggles with thoughts of suicide.

Following Clayton’s post, his boyfriend Knight took to Instagram to show his support.