Hilary Swank won an Oscar for her performance as a transgender boy in Boys Don’t Cry.

There has been a lot of debate over who should play LGBTQ characters in film recently, with Scarlett Johansson standing down from her role as a transgender man in the upcoming Rub and Tug, and criticism levied at Disney for casting straight comedian Jack Whitehall as its first gay character.

And now, actress Hilary Swank, who won an Oscar for her performance as transgender teenager Brandon Teena, who was murdered in 1993, in the biographical film Boys Don’t Cry, has weighed in on the debate. Speaking to G2 about the role, Swank acknowledged that were some people who said she shouldn’t have taken it.

She then added: “At the time, the whole community was grateful that I did it because they said, had it been someone who was from this experience, people would have said: ‘Oh, you’re just telling your personal story.'”

Speaking about today’s climate, she said: “What’s hard is that not everyone is given an opportunity, and that’s where I think the struggle is.

“The important thing to remember is people are wanting to be seen for who they are. And people are fighting for their space in the world. That I understand. But I do think it can be a slippery slope, because I don’t think anyone should be pigeonholed.

“And I do think that all genders should have an opportunity to be an actor and tell their stories. And I think that all genders should have the opportunity to audition for all types of roles.”

She then added: “I was honoured to be a part of the beginning of an important conversation. The community means a great deal to me.

“We all have the underlying sameness of wanting to be loved; to give love, to receive love. We all experience pain. It might be from different circumstances, but the pain is the same.”

And asked whether trans rights have improved since the murder of Brendon Teena 25 years ago, Swank said: “I don’t know how we define better.

“Expanding awareness is definitely growth. We have a long way to go still.”

Related: Hollywood agencies sign pledge to promote more opportunities for trans people in film