Andy Samberg revealed that a number of different endings to 'Palm Springs' were tried out.

The 41-year-old actor plays the role of Nyles in the rom-com and follows two strangers who fall for each other after getting stuck in a time loop after meeting at a wedding ceremony in Palm Springs and Andy revealed that it was a challenge finding the right ending to the flick.

In an interview with Collider, Andy explained: ''Without saying what the other ones were, we definitely went through many drafts of the ending. Different versions. We even shot a few different versions.

''We re-edited it a few different ways, and kind of landed on what we had by way of doing like small friends and family screenings and polling people until we got to one where, three screenings in a row after the ending we said, 'Did everyone like the ending?' And everyone raised their hand. And we were like, 'Alright, it might not be perfect but everyone liked it!''

The comic also explained how he hoped that the movie would combine a variety of genres.

Andy said: ''(We found the right ending) not for lack of trying. I would say what our goal was since the movie is a blend of genres, we wanted an ending that felt satisfying for the rom-com part of it, also not like a cop out for the nihilistic existential dread part of it, and also something that would be not complete gobbledygook for people who love sci-fi and were tracking the rules and the ins and outs and those types of things.

''So it was a very difficult needle to thread and obviously it would have been easy to push it further into any one of those three categories, and what we ended up with hopefully is the best version, which was satiating all three in some way, shape or form.''