Neal H. Moritz is producing the Sonic film, with Deadpool director Tim Miller executive producing, along with Toby Ascher. Tika Sumpter is also starring in the film.

Based on the popular SEGA video game franchise, Sonic the Hedgehog centers on Sonic and his friends, such as Tails and Knuckles, who run around collecting items and points as they attempt to foil the global domination plans of Doctor Eggman Robotnik.

Carrey will play Robotnik, aka Doctor Eggman, a mad scientist and Sonic’s archenemy.

For Carrey, the role could mark a semi-return to genres that helped him become one of the biggest comedy stars in the world. The actor achieved a triple play in 1994 when he starred and wowed in three movies in one year — Ace Ventura: Pet Detective, The Mask, and Dumb and Dumber. All were defining comedies, but The Mask was a zany confection that blended Carrey’s cartoony gifts with CGI and comic book stylings.

The actor, in more recent years, has been making more serious and dramatic fare, such as indies The Bad Batch and Dark Crimes. He has also been starring in Showtime’s drama Kidding.