Florence Pugh and Zach Braff at the UK premiere of  'A Good Person' on March 8.
CNN  — 

Zach Braff says his new movie, “A Good Person,” was heavily inspired by his ex-girlfriend, actress Florence Pugh.

“I’m just in awe of her talent and I said, ‘I wanna write this for Florence. What I’m writing is really gonna be challenging and she’s incredible,’” he told Entertainment Tonight while promoting the film.

Braff and Pugh dated for three years before parting ways in 2022.

Pugh plays Allison in the movie, a woman who survives a terrible tragedy and becomes addicted to opioids.

“She’s a next-level actress. I mean, she’s just unbelievable and what I was writing was going to be really challenging.” Braff told the publication. “It wasn’t for your average actors – I couldn’t have written the part for myself. I wanted to write something for her and I had this image in my mind of that diner booth scene and I thought of Florence Pugh opposite some legend that everyone’s talking about.”

On Monday, Pugh appeared on “The Tonight Show Starring Jimmy Fallon,” where she said Braff penned the script for her.

“He wrote it for me. I was his muse,” she told the host.

Morgan Freeman stars opposite Pugh as her would be father-in-law.