John Krasinski's new movie has been inspired by his children.

Emily Blunt and John Krasinski have been married since 2010

Emily Blunt and John Krasinski have been married since 2010

The 44-year-old actor wrote, produced and directed 'IF', a new live-action animated film, and John has revealed how his children inspired the project.

The Hollywood star - who has Hazel, 10, and Violet, seven, with his wife Emily Blunt - observed that his kids "disappear into a magical world that we, as parents, aren’t allowed into".

Speaking to PEOPLE, John shared: "I said to Emily, ‘That would make an amazing movie.’"

John also recalled the COVID-19 pandemic being a turning point for his children.

He explained: "They started doing fewer imaginary games, and they started to let the real world in. They started asking bigger questions and then finally said, ‘Are we going to be okay?'

"I said to Emily, ‘That’s kind of the definition of growing up, isn’t it? When you let fear in?’ I thought, ‘I have to do this movie right now to show them that magical world they created, they can go back.'"

Ultimately, John's children were actually pivotal in the production process.

He said: "I was just sketching all the IFs as I was writing and I would show them. I’m a terrible artist, so then once I started interfacing with real artists and talking about how it would really look, they got really excited."

Meanwhile, John also recalled how one of his daughters first discovered her "imaginary friend".

The actor - who has been married to Emily since 2010 - said: "Hazel’s a very empathetic soul, and we were making s’mores one night, and her marshmallow burst into flames as they tend to do, and she was so destroyed that she had hurt some sort of creature.

"And I said, ‘Oh, no, no, that’s just his thing. He lights on fire and then he goes out and then he lights on fire and then he goes out.’ And she loved that idea, and so that became her imaginary friend."