The late, great Robin Williams was often known to go off script and improvise like no other. 

It was his attitude that often contributed to the film veering off script during rehearsals and production.

"He was constantly improvising," co-star Stellan Skarsgard said during a panel at the Tribeca Film Festival on Wednesday, "And I liked that because if you prepare properly, it is trashed totally by somebody else improvising. And that's really good, because you usually get a little stiff, too skillful, and too elegant if your performance doesn't get f---ed by someone."

But Williams wouldn't just improvise his lines. He would go completely out of character. According to Skarsgard and director Gus Van Sant, Williams would typically do all of his lines while impersonating different celebrities.

"Every time, the first take, I came in and it wasn't him ... Jack Nicholson was standing there. He'd behave like Jack Nicholson," Skarsgard said. 

"Then we had to do it again and he was James Cagney. I think it was five or six takes with a different person every time," he continued. "And then gradually he did something more and more like the character."

Clearly, the other actors enjoyed improvising with him. Much of the improvisation took place in Sean's (Williams) office. According to Van Sant, Williams did an entire scene as Janet Reno, while Matt Damon played along with him as Daffy Duck. Another time, Williams did all of his lines as Frankenstein.

At one point, Van Sant asked Damon, "Isn't this fun?" To which Damon responded, "No! It's exhausting!"

Williams' performance in "Good Will Hunting" earned him his first and only Oscar. His acting method sounds atypical, especially when compared to how other Oscar winners typically prepare. It doesn't sound like Robert De Niro, for instance, who gained a record amount of weight for his Oscar-winning performance as boxer Jake La Motta in "Raging Bull."

Either way, this seemed to work for him. And it led to some of the film's funniest and most touching scenes like this one, where he tells a story about his wife:


And the final line in the film, which was his idea:


Unfortunately, these great moments were not captured on camera. But Robin Williams was always somebody who just wanted to make people laugh, whether or not the cameras were rolling.

NOW WATCH: This Lego version of the 'Batman v. Superman' trailer is absolute gold

See Also:

One of Matt Damon's Harvard professors gave him a small note that completely changed 'Good Will Hunting'A fan asked Christopher Nolan about the end of 'Inception' and he explained why he'd never tellChristopher Nolan says he's most proud of the opening scene in 'The Dark Knight Rises'

SEE ALSO: Fans Have Turned The Famous Bench From 'Good Will Hunting' Into A Memorial For Robin Williams