Robert Pattinson
Robert Pattinson almost got fired from “Twilight.” Pictured: Pattinson at the screening of “Good Time” in Cannes, France on May 25, 2017. Reuters/Eric Gaillard

“Twilight” star Robert Pattinson recently revealed that he almost got fired from the hit movie franchise that made him a household name.

In an interview with the New York Times, the 31-year-old actor said that his rebellious behavior almost cost him his big break in the film industry. Luckily for the actor, his agents managed to smooth things out with the people behind “Twilight,” so he reprised his role as Edward Cullen in the sequels.

Read: Cannes failed women in 2017, says Jessica Chastain

While at the Cannes Film Festival for the screening of “Good Time,” Pattinson told TIME (via People) that he feels lucky to have worked with the likes of Kristen Stewart, Taylor Lautner and Anna Kendrick in the “Twilight” franchise. “It was amazing luck, as well, to just have fallen into it with the group of people I worked with on it,” he said.

Pattinson also didn’t mind portraying the role of a vampire named Edward in the five films of the “Twilight” franchise. After the saga wrapped up, the actor branched out to grittier projects. However, none of these movies were as commercial as “Twilight.” “I think one of the best things, basically, about being a bit of a sellout, is if you’ve done five movies in a series, you’ve had to accept some responsibility for playing the same character,” he said.

But it was only in 2012 that he started receiving praise for his acting chops when he starred in “Cosmopolis.” Talking about the project, Pattinson said, “I especially love the fact that it came out at the height of my popularity. It was the big turning point for me. I just realized that was what I wanted to do.”

Meanwhile, Pattinson has harnessed the “Twilight” legacy into his proceeding projects, which includes going dark in certain art films that make their way to Cannes. Pattinson also confessed that despite his success, he still feels like he looks ugly in every take in front of the camera.

“I can’t say that about anyone that I work with. I’ve never seen anyone give themselves such a hard time. I’m beating myself up afterward. And I think there’s some weird perverted energy that comes out of when people criticize previous work or think you represent this certain thing; it gives you this energy,” he explained.