Ben Affleck revealed to Entertainment Weekly in a recent interview that close friend and film collaborator Matt Damon played a key role in getting him to reshape his career following the rock bottom experience of working on “Justice League.”

Affleck called Damon “a principal influence” on his decision to draw a line in the sand when it came to the kinds of parts he was going to tackle. Affleck’s experience working on “Justice League” was something he vowed never to emulate again in his career.

“I had a really nadir experience around ‘Justice League’ for a lot of different reasons,” Affleck told Damon for EW. “Not blaming anybody, there’s a lot of things that happened. But really what it was is that I wasn’t happy. I didn’t like being there. I didn’t think it was interesting. And then some really shitty things, awful things happened. But, that’s when I was like, I’m not going to do that anymore.”

“I talked to you about it and you were a principal influence on that decision,” Affleck continued. “I want to do the things that would bring me joy. Then we went and did ‘Last Duel’ and I had fun every day on this movie. I wasn’t the star, I wasn’t likable. I was a villain. I wasn’t all the things I thought I was supposed to be when I started out and yet it was a wonderful experience. And it was all just stuff that came along that I wasn’t chasing.”

Affleck co-wrote “The Last Duel” with Damon and Nicole Holofcener, and he also was featured in a supporting role as Count Pierre d’Alençon, for which he received acclaim. While Affleck has vowed not to return to the lows of “Justice League,” he will be reprising his role as Batman in the upcoming tentpole “The Flash.” The actor told The Herald Sun earlier this month that playing Batman again was far healthier for him than before.

“Maybe my favorite scenes in terms of Batman and the interpretation of Batman that I have done were in the Flash movie,” Affleck said. “I hope they maintain the integrity of what we did because I thought it was great and really interesting — different, but not in a way that is incongruent with the character.”

Warner Bros. is set to open “The Flash” in theaters nationwide Nov. 4.