Rex USA 1 / 5

By Us Weekly

Ben Affleck, like millions of friends and fans, said he is "heartbroken" about Robin Williams' sudden death. The actor, 41, released a statement via Facebook on Tuesday, Aug. 12, remembering his "Good Will Hunting" costar and thanking Williams for giving him a shot at a young age.

PHOTOS: Robin Williams' most iconic roles in film and TV

"Heartbroken," Affleck wrote. "Thanks chief - for your friendship and for what you gave the world."

Affleck went on to remember Williams' warm and kind persona -- even before he and best friend Matt Damon rose to fame when they costarred with the comedian in the 1997 drama.

"Robin had a ton of love in him," Affleck said. "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."

PHOTOS: Robin Williams remembered by former costars, family

Williams won a Best Supporting Actor Academy Award for his performance in "Good Will Hunting" as Dr. Sean Maguire, a therapist grappling with the death of his wife. Damon starred as central character Will Hunting, a closet genius who becomes the patient of Maguire. In the movie, Affleck played Damon's best friend Chuckie Sullivan, while Minnie Driver played his love interest Skylar.

VIDEO: Watch a montage of Robin Williams' greatest performances

The film itself was nominated for nine Oscars, including the Academy Award for Best Picture. Best buddies Damon and Affleck, who were in their mid-20s and at the beginning stages of their careers at the time, also won the Oscar for Best Original Screenplay.

PHOTOS: Stars gone too soon

Williams was found dead Monday, Aug. 11, from an apparent suicide. Following his death, the actor's family and close friends paid tribute to the beloved comedian.

"May you find peace my friend," Affleck concluded. "#RobinWilliams."