The positive-minded script of Yes Man attracted Jim Carrey to his first comedy in three years, he has explained.
Carrey stars as Carl Allen in the adaptation of Danny Wallace's book, a tale of saying "yes" to every opportunity that comes before you.
And though he said it was "an illusion" that he had moved away from mainstream comedies, the 46-year-old explained it was the chance to "put something good out into the world" that enticed him to Peyton Reed's comedy.
"I feel like it's time for a shift in the paradigm out there, from cynicism to faith, and belief in a good future", he told a London press conference.
"And this attracted me in that way."
He continued: "I just do whatever I'm attracted to. It's like the woman who stands out in the crowd who, for some reason, you notice and that's the one you're supposed to dance with.
"That's what it is with scripts. They find you when you're in the right place to do them.
"With Eternal Sunshine [of the Spotless Mind], I was broken-hearted and [director] Michel Gondry said: 'You are beautiful like this'.
"I said: 'But we're not shooting for another year' and he answered: 'Don't get well.'
Zooey Deschanel, Bradley Cooper and Rhys Darby also star in Yes Man, which is released on Boxing Day.