Some pro-transgender Twitter users slammed actor Sebastian Croft for appearing in a game with ties to author J.K. Rowling, who has been attacked for being anti-trans.

Croft, who made it big on "Heartstopper," a Netflix series about high school boys who fall in love, denounced Rowling on Twitter in a post that has been viewed over three million times. 

The actor told his fans that he was cast in "Hogwarts Legacy" — an action role-playing game set in the "Harry Potter" universe — years before he knew about Rowling’s "views" on transgender issues.

"I was cast in this project over three years ago, back when all Harry Potter was to me, was the magical world I grew up with. This was long before I was aware of JK Rowling’s views. I believe wholeheartedly that trans women are women and trans men are men."

DEBATE RAGES ONLINE OVER NEW 'HARRY POTTER' VIDEO GAME: 'SHE WHO SHALL NOT BE NAMED'

Emma Watson Harry Potter

"Hogwarts Legacy," set in the "Harry Potter" universe, is one of the most anticipated games this year.

The official Twitter account for "Hogwarts Legacy" broke the news on Jan. 11, revealing that Croft was the voice behind one of the main characters in the game.

While most comments were positive, some users complained that Croft was acting like a hypocrite. 

One user commented that "this is so horribly ironic I don't even know what to say."

HARRY POTTER BOOKS STRIPPED OF J.K. ROWLING'S NAME ARE THEN RESOLD BY 'BOOKBINDER ARTIST'

Another Twitter user with the name "transisawesome" didn't buy Croft's story as to why he chose to voice act for "Hogwarts Legacy" and called him out for not supporting "trans people." 

‘"[Q]ueer was always here’ includes trans people," the user wrote. "Just reminding you bc you apparently forgot what your own merch stands for."

Croft apologized and promised his fans that he would do better in the future. "I know far more now than I did three years ago, and hope to learn far more in the next three. I’m really sorry to anyone hurt by this announcement. There is no LGB without the T," the actor wrote, adding a heart sign.

The actor amassed a huge following partially for his role on "Heartstopper," an unapologetically pro-LGBT show that premiered in April 2022. It is also extremely popular online, drawing over nine billion views on TikTok, alone. The game "Hogwarts Legacy," on the other hand, has only 49 million views on TikTok. 

HARRY POTTER 'BOOK ARTIST' WHO REMOVES J.K. ROWLING'S NAME IS WITHIN HIS RIGHTS: LEGAL EXPERTS

'Protect Trans Youth' protesters

Some pro-transgender Twitter users slammed Croft for appearing in a game with ties to author J.K. Rowling, who has been attacked for being anti-trans. (Fox News )

But in the gaming world, Hogwarts Legacy is one of the most anticipated titles of the year. Preorders for it have shot up, making it the top-selling game on download platform Steam. 

Croft did not immediately respond to a request for comment from Fox News Digital. 

CLICK HERE TO GET THE FOX NEWS APP