In 2010, he voiced Gru's arch-rival Vector in the Universal's CGI animated film, "Despicable Me" and appeared as "Horatio" in a fantasy comedy film "Gulliver's Travels" directed by Rob Letterman and very loosely based on Part One of the 18th-century novel of the same name by Jonathan Swift. Segel appeared in "Bad Teacher", starring Cameron Diaz, which opened in June 2011. He played gym teacher and thwarted suitor Russell Gettis. Along with Nicholas Stoller, Segel approached Disney in 2007 to write the latest "Muppets" film. Disney was unsure on how to take the request, as Segel had just done frontal nudity in "Forgetting Sarah Marshall", but after realizing that he was an avid fan, the project was approved. Segel stated that he wanted to do the film because the last film in the series to be released in theaters was "Muppets from Space" in 1999, and he felt that the younger generation was missing out on enjoying one of his childhood favorites.