Back in 2008, Jason Segel starred in 'Forgetting Sarah Marshall,' where he tried to get over a breakup from Sarah (Kristen Bell) by moving on with Rachel (Mila Kunis). And while the lucky on-screen Peter got to get with both ladies by the end of the film, the real-life inspiration for the movie wasn't that great.

In fact, it's based on the lead actor's breakup with one specific person.

Jason Segel used his own relationship history to sketch out the idea for 'Forgetting Sarah Marshall,' says IMDb, although it wasn't a single ex that inspired the plot.

RELATED: Here's What Jason Segel's Been Up To Since 'How I Met Your Mother'

Segel's relationship history is pretty interesting on its own, so it's not surprising that he made it into a film. But basing a film on a personal breakup experience is a little awkward, especially since one of the scenes involves a 'nude' Jason being dumped by Kristen.

The fact is, says IMDb, that the nude breakup scene wasn't inspired by Segel's breakup from one notable star. But his ex Linda Cardellini did inspire parts of the film, notes the site, and Jason infused parts of his experiences into the script.

As the script-writer for the project, Jason had full creative control over the way the story went, including how his romantic scenes happened. Funny that he wrote himself into relationships with both Kristen Bell and Mila Kunis, right!?

But although he did date Linda Cardellini (fans learn something new about the actress all the time!), the breakup wasn't as bad as the one Peter has with Sarah Marshall.

Jason Segel as Peter in 'Forgetting Sarah Marshall'
via Amazon

In fact, Jason said Linda was "a great girlfriend," according to IMDb. Which then begs the question, why did he write a romantic comedy with a heartless ex-girlfriend, and then say that Linda inspired parts of the script?

Of course, IMDb also says that Jason drew on other exes to flesh out his plot and script. All told, three other breakups with "unspecified women" also contributed to the story. Though Jason's had a few girlfriends over the years, the only one that has been confirmed as official enough for Wikipedia is his one-year partnership with Michelle Williams.

These days, Michelle is married to Thomas Hail, of course. But luckily for the actress, she dated Jason after the film 'Forgetting Sarah Marshall' came out -- so there's no way fans could misinterpret that she was behind any of the toxic ex themes.

And what about the fact that Russell Brand played the new boyfriend of Jason's ex? He did add some additional comedic value to the plot, but it seems like his relationship history probably didn't factor into the storyline at all.

NEXT: Mila Kunis's Biggest Roles, Including 'That '70s Show'