Photo: Alex J. Berliner/BEImages

Robin Williams, Ben Affleck, Matt Damon

Ben Affleckis reflecting on what he learned fromRobin Williams.

Affleck, 49, worked with Williams on the1997 filmGood Will Hunting, for which he won an Academy Award for Best Original Screenplay (with pal Matt Damon) and Williams won for Best Supporting Actor.

In his new filmThe Tender Bar, Affleck plays Uncle Charlie, a father figure to the main character who offers guidance and life wisdom. In an interview with Jake’s Takes, he was asked if Williams, who died in 2014, serves as that level of mentor to him.

“I just thought, ‘Well if this guy can do it and be kind to people and collaborate and work with people and care about them and listen to them, I certainly can,’ " he added.

Never miss a story — sign up forPEOPLE’s free daily newsletterto stay up-to-date on the best of what PEOPLE has to offer, from juicy celebrity news to compelling human interest stories.

“He was a really extraordinary, kind, loving guy, and that to me is the legacy of Robin. That’s what his comedy was rooted in, kind of a basic goodness and humanity,” Affleck continued. “I wish I had known him my whole life. Growing up, I didn’t have that opportunity, but when I did meet him, I was a pretty young guy; I was 24. It made a massive impression on me and I thought, ‘Okay, that’s how you do this. I’m going to spend my life trying to live up to this example.’ "

RELATED VIDEO: George Clooney Praises PalBen Affleckas ‘Such a Good Actor’ After Directing Him in New Movie

Back in August 2014, after news of Williams' sudden death at age 63, Affleckwrote at the time on social media, “Heartbroken. Thanks chief — for your friendship and for what you gave the world. Robin had a ton of love in him. He personally did so much for so many people. He made Matt and my dreams come true. What do you owe a guy who does that? Everything. May you find peace my friend.”

source: people.com