LOS ANGELES — Peering through his camera at Robin Williams in 2012, the cinematographer John Bailey thought he glimpsed something not previously evident in the comedian’s work. They were shooting the independent film “The Angriest Man in Brooklyn,” and Mr. Williams was playing a New York lawyer who, facing death, goes on a rant against the injustice and banality of life.
His performance, Mr. Bailey said Tuesday, was a window into the “Swiftian darkness of Robin’s heart.” The actor, like his character, was raging against the storm.
That defiance gave way on Monday to the personal demons that had long tormented Mr. Williams. With his suicide at age 63, Mr. Williams forever shut the window on a complicated soul that was rarely visible through the cracks of an astonishingly intact career.
Given his well-publicized troubles with depression, addiction, alcoholism and a significant heart surgery in 2009, Mr. Williams should have had a résumé filled with mysterious gaps. Instead, he worked nonstop.
At the very least — if his life had followed the familiar script of troubled actors — there would have been whispers of on-set antics: lateness, forgotten lines, the occasional flared temper.
Not so with Mr. Williams. “He was ready to work, he was the first one on the set,” said Mr. Bailey, speaking of Mr. Williams’s contribution to “The Angriest Man in Brooklyn,” of which he was the star.
“Robin was always 1,000 percent reliable,” said a senior movie agent, speaking on the condition of anonymity to conform to the wishes of Mr. Williams’s family. “He was almost impossibly high functioning.”
As Hollywood struggled on Tuesday to understand how Mr. Williams — effervescent in the extreme — could take his own life, authorities released details of his death. A clothed Mr. Williams hanged himself with a belt from a door frame in his bedroom in Tiburon, Calif., according to Lt. Keith Boyd, assistant deputy chief coroner for Marin County.
Mr. Williams’s wife, Susan Schneider, went to bed at 10:30 Sunday night and woke up on Monday believing her husband was still asleep in a separate bedroom. A personal assistant, concerned that he was not responding to knocks on his door, discovered the body, cool to the touch and with rigor mortis, at about 11:45 a.m. on Monday.
Mr. Williams, who had recently been treated for severe depression, was declared dead at 12:02 p.m. Officials found a pocketknife in the room, apparently with dried blood on it, and superficial wounds on Mr. Williams’s left wrist, said Lieutenant Boyd, who declined to say whether there was a suicide note. Toxicology reports are still pending.
To a large degree, said studio executives and agents who worked with him, Mr. Williams seemed to use work as a way to keep his personal demons caged. At an age when most actors are slowing down, Mr. Williams was engaged with a half-dozen recent and planned projects. They ranged from stage work and low-budget films to an anticipated — though still distant — big-budget sequel to his biggest hit, “Mrs. Doubtfire,” which took in about $728 million worldwide in 1993, after accounting for inflation.
Seeming to thrive on performance, despite the undertow of depression andsubstance abuse, Mr. Williams interrupted a live comedy tour for his heart surgery in 2009. But he quickly returned to finish his run. Stanley Wilson, a film producer who attended Juilliard with Mr. Williams and remained a close friend until the end, said a 2011 stint on Broadway left the actor “overwhelmed with joy.”
“He was totally proud” of his recent work, Mr. Wilson said, speaking by telephone on Tuesday. But he acknowledged that Mr. Williams had long been a “melancholic guy.”
Experts say that it is impossible to predict who will commit suicide. The act is so radical, individual and rare that it defies precise scientific analysis.
But there are factors that increase its likelihood, experts said, and many of them were Mr. Williams’s longtime companions: drugs, alcohol, depression. After a cocaine-fueled early career, Mr. Williams quit cold turkey in the mid-1980s and strung together two decades of sobriety before returning to alcohol while shooting a movie in Alaska, according to his own public statements. He entered rehab in Oregon in 2006.
Mr. Williams was also a middle-aged white male facing career challenges — his 2013 television series, “The Crazy Ones,” was canceled by CBS after one season — only a few years after the heart surgery. More than 70 percent of all suicides in the United States are white men, most of them in their middle years, and many take their lives in the wake of some loss, whether professional, personal or physical.
Charles J. Biederman, a Los Angeles lawyer who represented Mr. Williams in entertainment dealings, strongly refuted tabloid reports on Tuesday that the actor was in acute financial distress.
“No, no, he was doing fine,” Mr. Biederman said. Other members of Mr. Williams’s professional coterie also insisted that money problems were not an easy explanation for what happened. “He didn’t have crazy money like before his divorces, but the coffers were still full,” said a person who worked closely with Mr. Williams, who was currently on his third marriage.
Mr. Wilson said: “He was not broke. He got highly paid for the series, and he just did two movies.”
Mr. Wilson did acknowledge that money had been an issue for his friend roughly two years ago. In an interview with Parade last year, Mr. Williams said as much, telling an interviewer that he had decided to do “The Crazy Ones,” his first steady TV job in 30 years, because of the paycheck. Mr. Williams’s salary for the show was reportedly between $150,000 and $200,000 an episode, which for a season of 22 episodes could have paid more than $4 million.
“There are bills to pay,” Mr. Williams told Parade, adding that he had recently re-listed his Napa ranch for $29.9 million because “I just can’t afford it.” (The ranch, initially listed in 2012 for $35 million, is still for sale.)
Whether for emotional or financial reasons, Mr. Williams in recent years increased his workload, even taking on commercials. He played a football coach unhinged by hunger for Snickers and his voice was used in spots for iPad Air devices.
His 2006 relapse appeared related to concern about his ability to keep working. “It’s fear,” Mr. Williams said in a 2010 podcast interview with the comedian Marc Maron. “You’re kind of going, ‘What am I doing in my career? Where do you go next?’”
Mortality also appeared to weigh on him. While shooting “Boulevard,” an indie drama that was filmed in Tennessee in the spring of 2013, Mr. Williams spoke pointedly about the recent death of another famous comedian — his idol, Jonathan Winters.
“On set, Robin talked about losing Jonathan Winters in all his brilliance and goodness, like any other fan,” said Dito Montiel, the director of “Boulevard.”
For Mr. Bailey, Mr. Williams’s little-seen performance in “The Angriest Man in Brooklyn” is the comedian’s “defining role,” revealing him for the tormented, if comic, soul that he really was.