 Disney also appointed the duo Joel Cohen and Alec Sokolow and, later, Joss Whedon to help develop the script.Whedon found that the script wasn't working but had a great structure; he added the character of Rex and sought a pivotal role for Barbie.He also re-visioned Buzz Lightyear from a dim-witted but cheerful and self-aware character to an action figure who isn't aware that he's a toy—an epiphany that transformed the movie.