(Vo) Play Cash 4 Life from the New York Lottery. Drawings ever Monday and Thursday. ? Surprise, surprise, surprise. Reporter: Few doubted that robin Williams was a spectacular talent. My first day was...  (Vo) Play Cash 4 Life from the New York Lottery. Drawings ever Monday and Thursday. ? Surprise, surprise, surprise. Reporter: Few doubted that robin Williams was a spectacular talent. My first day was a woman and I'm getting hot flashes. His comedic sensibility. I'm melting help me. Reporter: Where did it come from and how to put it all to use. What was special about him? Well, he was always on. Reporter: Garry Marshall put robin Williams first in happy days, then in "Mork and Mindy." What was it about him that made you call him a genius? Well, because you never knew what he was going to do. You never figured it out. Let's all get funky. I can't get no satisfaction. Reporter: Casting him first as Mork from Ork was the sitcom E equivalent of a Kos Mick Sha hug. He said it was in the script. Don't take away my Gus toe. Help me, I'm melting. And he was wonderful and I yelled, cut. And I said, Sam, did you get that and Sam said he never came by here. Reporter: Unleashing his improvisational gifts proved a challenge for the big screen. The caribbean comedy club paradise, Williams would say, I thought I could fix it. Not so much. It was director Barry Levinson who would give Williams total freedom, casting him as an armed forces radio deejay in war time. Where are you stationed? What's the weather like out there? It's hot, damn hot, damn hot. It's so damn hot I burst in flames. What do you think it's going to be like tonight? Hot and wet. Nice if you're with a lady but not when you're in a jungle. Reporter: The result was "Good morning Vietnam" in 1987, the first film as on the edge as Williams' stand-up comedy. By 1992 he was playing the genie in "Aladdin." Another showcase. You need more power. Don't be afraid. You had it all along. I never did it. I am not at fault. Let's make some magic. Reporter: His mega riffs in the recording studio would be animated afterwards. Princess jasmine, you're very -- very splendid, wonderful, magnificent, glorious. I recorded that with robin Williams and he was so funny. I tried so hard not to laugh but I'm sure I ruined a couple of takes. Thanks, genie. I'm getting kind of fond of you, kid. I don't care what I am. Reporter: By then this on screen Camille Yan was exploring another side of his performing several. He would harness his free-wheeling style. Just when you think you know something, you have to look at it another way. Reporter: To play characters eager to connect on a deeper level as this English teacher through poetry. Gather Yee roast. Reporter: It was called "Dead poets society." Harrison Ford joked that the only title less commercial would have been "Dead poets society" in winter. And with a young cast that included future stars eitheren hawk, Robert SHAWN Leonard and josh Charles, it give Williams a new empathetic direction on screen. Thank you, boys. You're just a kid. You don't have the faintest idea of what you're talking about. Reporter: That would win him the best supporting actor Oscar in "Good will hunting." "Mrs. Doubtfire" became his signature work. Oh, how lovely. We've got five hours. Reporter: He would do more spirited comedy, too, with Nathan lane in "The birdcage." Get that down. Make your findings like I am, all right. Stop trembling. Hold the knife Bolding. I pierced the toast. Reporter: Through it all it wasn't always easy figuring out what had made him so gifted and what drove him to the depths of comedy that dominated on movie screens and shined so brightly on talk shows and interviews. A little something from the Elvis estate. But to say hello and talk about the weather -- Why do you think that was? I don't know. We never found out. Reporter: It wasn't the sort of thing a rapid fire routine could reveal. And even Garry Marshall wasn't sure what happened when Williams wasn't on. I mean, everybody has demons and I thought he could make it, so I was totally shocked when this happened. It's difficult when somebody that entertaining goes, because it wasn't he was a good one, he was the best. Reporter: That comic gift, the ability to pull connections out of the air, to take the freedom that stand-up and TV shows gave him and bestow laughter over and again on an eager and grateful public, that was special and undeniable. Bless your heart, you make us laugh. You make us feel good, robin. You know that? Thank you. It's my day job, thank you. Don't ever quit your day job. Thank you. Reporter: It was that brilliance that made robin Williams a star and linger in the hearts of those who never met him and those who knew him for decades. Very sad. I grew up in the streets of the bronx but I cried. He was a good man. I'm glad I knew him. I think everybody was. You take care of yourself.  This transcript has been automatically generated and may not be 100% accurate.
Part 4: From "Mork and Mindy" to "Good Will Hunting," a look at some of the actor's iconic roles.