Fans today can't imagine anyone but Jim Carrey playing Ace Ventura in the film 'Ace Ventura: Pet Detective' and its sequel ('When Nature Calls'). But originally, Jim Carrey wasn't meant to play Ace at all, though fans are glad he swooped in and saved the movie.

The truth is, notes IMDb, that Adam Sandler was originally offered the part of Ace. Sandler turned down the opportunity — maybe he was too busy playing Billy Madison at the time? — which turned out serendipitous for the producers.

RELATED: Jim Carrey & 9 Other Celebs Who Were Rejected By Saturday Night Live

Back in the '90s, some thought Jim Carrey was at the height of his career. 'The Mask' was a resounding success, and it came out the same year as 'Ace Ventura' and another Carrey hit, 'Dumb and Dumber.' Plus, around that time was when dating rumors featuring him and Cameron Diaz started to circulate.

Fast forward more than a decade, and Carrey's role in 'Ace Ventura' nearly earned him a cameo in 'Captain Marvel.' Clearly, it was epic. But how did it come about?

Well, after Adam Sandler said no to the part, Jim auditioned and flipped the script — literally.

Instead of letting Ventura become a 'bumbling idiot' as the script indicated, Jim transformed him into a quirky yet intelligent pet detective. Carrey's influence is also what resulted in the phrase 'all righty then' featuring heavily in the film.

Thanks to Jim, the character of Ace took on a life of its own. But it wasn't just the catchphrases that helped save the movie from becoming a box office bomb; Carrey really fleshed out the character, taking his inspiration from other great actors.

Jim Carrey as Ace Ventura in 'Ace Ventura: Pet Detective'
via Commercial Appeal

For example, as IMDb explained, Jim has said he modeled Ventura after birds; his inspiration was 'a cockatiel or a parakeet of some kind.' The wardrobe was even based on avian style; Jim imagined a colorful, tropical bird while picking out Ace's clothing.

All of that effort channeled into the film secured its spot as a top comedy over the years, even if the character of Ventura was insufferable. Despite the movie's success — and the character's popularity — plenty of people still disliked the movie overall.

That didn't stop it from earning millions, of course.

RELATED: Which Movie Made Jim Carrey The Most Money?

But Carrey also hasn't had a role quite like 'Ace Ventura' ever since. Although, maybe that's a good thing. Instead of continuing on as Ace, Carrey has become Lemony Snicket, portrayed Mr. Popper, and turned into an evil villain in 'Sonic the Hedgehog.'

Who knows what he's going to do next — maybe he'll reprise his role as Ace after all.

NEXT: Which MCU Villain Did Jim Carrey Almost Play?