Gabrielle Union on Her Anti-Gay Mother in ‘The Inspection’

After nearly 30 years of working in Hollywood, Gabrielle Union is used to facing slings and arrows. Still, when she opens up Twitter and sees people attacking her trans daughter, Zaya Wade, it hits differently.

Or, as Union put it to me Thursday night at the after-party for “The Inspection,” which opened the Toronto International Film Festival: “You can say whatever about me — normally, I’m going to come with these fists, or I’m going to read you for filth. But when it’s your child, it’s a whole different ballgame.”

As the loving parent of a trans teenager, Union and her husband, the former N.B.A. player Dwyane Wade, have become outspoken role models for parents of L.G.B.T.Q. children. “People are listening to me,” Union said, “and I have a responsibility to try to reach those parents if I can.” But in “The Inspection,” Union plays her total opposite: Inez, a flinty, chain-smoking prison guard whose homophobia is so deeply ingrained that she kicks her son out of the house at age 16 for being gay.

“None of our children are disposable, but trying to shove that down and bring Inez forward was the challenge of a lifetime,” Union said after the film’s premiere, adding, “This is the most important work I’ve ever done.”

The film, which is based on the writer-director Elegance Bratton’s own life story, follows Ellis (Jeremy Pope), who has spent years living on the streets of New York since his mother severed all ties with him. Desperate to turn his life around, Ellis enlists in the Marines and faces a hellish boot camp made even worse by the homophobic hazing from his fellow recruits. Still, Ellis perseveres, hoping that if he makes it through, that triumph can begin to repair the rift with the mother he still deeply loves.

Union is best known for films like “Bring It On” and “Bad Boys II,” and though she rarely plays roles like the glammed-down, obstinate Inez, who is so disgusted by her son that she puts newspaper down before allowing him to sit on her couch, Bratton told me Union was always his first choice for the part.

“In the Black community, she’s an icon,” Bratton said at the after-party. “I’ve always thought of her as the Black Charlize Theron, and I’m like, ‘Where are the parts to justify how I feel about her?’”

Still, he confessed to an ulterior motive for casting her. Ever since Bratton was kicked out of his mother’s house as a teenager, “a huge part of what’s driven me is the idea of being unavoidable to people who don’t want to see me.” With the cultural cachet Union carries, Bratton hopes her presence will make “The Inspection” impossible to ignore.

“Beyond her obvious talent, her beauty, and who she is as an activist and a superstar, she is a name that my mother would never be able to avoid,” he said. “Somebody will come to her and say, ‘Hey, Gabrielle Union played you in a movie. And she will see that movie, and I always hoped that when she saw it, it would change things between us.’”

Bratton’s mother died while he was putting the movie together, and as he watched Union channel her on set, things often got so emotional that Union would come to the monitor and comfort him after a scene.

“I say similar things to my own child that I said to Elegance,” Union recalled. “I’m not his mom, but what I can be is a loving adult. So hopefully there was some healing in there.”

Did playing the character give Union insight into the people who attack her family on social media? Some, she said.

“For Inez, and for a lot of the people I know, the commitment to the American dream — and the complete assimilation in order to be seen as worthy of upward mobility and opportunities — can literally drive you to abandon your own children,” Union said. “The lengths that people will go, to appear worthy to people who wouldn’t spit on you if you were on fire!”

The actress continued, “Anything outside of what a very wealthy cis-het white man with power tells you is acceptable or appropriate or reasonable, you’ll cut off your arm if that’s what they tell you to do: ‘You’ve got to talk this way, you’ve got to walk this way, you’ve got to be this way! You’ve got to be straight and Christian! You can’t have sex in any other position other than the same old 6 o’clock with a very specific kind of person!’”

And the desire to be seen as perfect in the eyes of the world isn’t worth it, said Union, who mentioned LeBron James, her husband’s longtime friend and former teammate. “Everyone likes to hold him up as an example: Rose out of poverty, single mom and became the best basketball player in the world.” But even with all that power, Union noted, the front gate of his Los Angeles home was still vandalized with a racial slur on the day before he was supposed to take the court in the 2017 N.B.A. finals.

The lesson? “You can comport yourself and shape-shift constantly, and it doesn’t matter,” Union said. “So be yourself, and don’t throw away your kids. You think it’s going to get you further? It doesn’t. All you’ve done is lose a piece of you.”