Joel Edgerton was clearly the guy in charge on the set of “The Gift.” He not only plays one of the three key characters, but also directs the film, based on his own screenplay.

While in town recently, the Australian actor and filmmaker — best known for starring in such films as “Exodus: Gods and Kings,” “The Great Gatsby,” “Zero Dark Thirty” and “Warrior” — sat down to chat about the origin of this new movie (opening Friday).

“The genesis of the idea was to tell a story that reflected on the idea of bullying, but it was about a guy 25 years after high school who, just on a shopping trip, runs into the guy he terrorized back in high school — and then, how that may play out.”

Bullying is very much in the news now, and Edgerton knows the issue from both sides of the fence.

“I’ve been involved in that sort of pack mentality in high school of being on the bullying side, which I think is born out of the anxiety of being left out of a group. That sadly leads to a lot of bad behavior,” he said.

“But also, I understand what it’s like to be bullied as a teenager.”

In “The Gift,” Jason Bateman and Rebecca Hall play an apparently happily married couple who move to Los Angeles from Chicago when Bateman’s Simon character lands a terrific new job. WThey run into Edgerton’s character, nicknamed Gordo, who approaches Simon and reminds him they were high school classmates. That reconnection leads to a dark turn of events, which turns the film into a psychological thriller — full of scary moments ultimately leading to a shocking end.

The Aussie actor and director hopes his movie will make people think about the roles “we played in high school. … Have we remained that same person or have we truly changed? I think we will come to discover the answer to that question as we watch Jason Bateman in this film.”

While it wouldn’t have made for much of a film, a key twist could have taken Edgerton’s plot in a very different direction: if Bateman’s Simon had immediately recognized Gordo, apologized for the terrible things he did to him in high school “and perhaps that apology could even have led to a new friendship,” Edgerton said.

“Of course that doesn’t happen,” said Edgerton, “because Jason’s character sees what happened 25 years ago as not such a big deal. … He doesn’t comprehend what that bullying experience did to Gordo, who sees his life changed in a very dramatic and negative way, based on Simon’s actions of so many years ago.”

On inspiration for Edgerton, as he crafted the framework for “The Gift,” was looking back at “all those movies I loved in the ’80s and ’90s — films like ‘Fatal Attraction,’ for example.

“Those are movies you can call triangle thrillers: stories where you have a well-meaning couple besieged by a psychopath or a sort of weird third-party.

“I wanted to achieve that here, but by going a bit of a different route — taking an approach where there is plenty of mystery and suspense, but without things becoming bloodthirsty or truly violent. I wanted the implication of violence. The danger that could be lurking outside your front door, but not an experience that would lead to a big body count.”

As for the house where they shot “The Gift,” a stunning mid-century modern edifice that is Simon and Robyn’s new home in the film, it provided Edgerton with a nice homage to his youth.

“When we started looking for locations and we found this particular house, it reminded me of a house I lived in as a child.

“It was a house that had a lot of glass — a lot of big windows — in a rural environment. I was always terrified when I was inside that house at night, thinking everybody could see me, even though I couldn’t see them. I had visions of bad guys lurking out there at night.

“This house in the film starts out as being very inviting, and an idyllic and aspirational place to live. But then it suddenly takes on this very sinister feeling, once the couple start to feel like their life is being encroached upon. That was important to helping  bring in the darkness we need as the story moved along.”