Ben Schwartz and Sam Rockwell are to star in a new comedy.

'Parks and Recreation' star Schwartz has penned the script for the movie for Searchlight Pictures.

Plot details are yet to be released, although Schwartz and 'Jojo Rabbit' star Rockwell are reported to be executive producers on the flick.

Schwartz recently admitted that he had written a movie for Seth Rogen and Adam McKay that was loosely based on 1985 family adventure film 'The Goonies'.

The 38-year-old actor said: ''I wrote a movie ... Adam McKay was the producer and Seth Rogen, that was basically an adult 'Goonies'.

''It's not the actual 'Goonies'. But what happened was what happened if that group of kids never got in and then became a group of screw-ups and then that cave opens and they go on their adventure. I love 'The Goonies'''.

Schwartz also voiced the titular character in the recent 'Sonic the Hedgehog' movie and admitted that the project was ''lucky'' to have Jim Carrey, who played villain Dr. Robotnik, on board.

He said: ''I think we just got lucky that Jim Carrey happened to decide he just wanted to do this movie. Because Jim Carrey being [in] just legitimises the whole thing.

''And then also he's just like, 'I'm gonna do comedy, the type of comedy that you've seen me do back in the day, I'm gonna do that again.' He can do everything and he's like, 'I'm gonna choose this.'''

The 'Night School' star did not get to see Jim at work on set and revealed that he was blown away after witnessing his performance at the cinema.

Ben explained: ''I mean when I watched it for the first time I literally went to - we were in a small theatre with just like three or four people - and I was like, 'Oh my god,' because I wasn't on set.

''So, the first time that I saw Jim Carrey stuff was when I was getting screened and I was like, 'Oh my god, we are so lucky. He just decided this is the movie he's gonna do this again in.'''