Robin Williams has left his estate valued at $50 million to his three children - with his wife Susan Schneider cared for under the terms of a prenup they signed before their 2011 wedding.

MailOnline has obtained a copy of the late star's will, which is dated January 31, 2011, and was filed last week at court in Marin County, California, three months after his death.

His beloved children, Zachary, 31, Zelda, 25, and Cody, 22, are looked after by the Robin Williams Trust, which is now being run by a trustee.

And after two failed marriages which reportedly cost him $30 million, Robin ensured that he and his third wife Susan signed a prenup agreement, which is dated September 28, 2011.

Devastated: Robin Williams' widow Susan Schneider (pictured with the star in 2012) prayed over his body before she allowed it to be removed from their home following his death on August 11. She is being cared for financially after the couple signed a pre-nup before their 2011 wedding

Cared for: Robin Williams has left provision for this three children in a trust, according to his newly filed will. The late star is pictured with, from left, son Cody, son Zak, ex-wife Marha Garces, and daughter Zelda in 2005

The couple wed at the luxurious Meadowood Resort in the Napa Valley town of St. Helena, California, a month later on Oct. 22, 2011.

The troubled comic was found hanging from a belt at his home in Marin County, California, on August 11. He was 63.

On Friday, authorities formally ruled the star's death as suicide as it was revealed he was struggling with a recent diagnosis of Parkinson's Disease, anxiety, depression and paranoia.

At the time of his death, Robin and Susan were sharing a house in Tiburon, CA, which is now valued at more than $7 million.

It is not known whether Susan will be able to stay at the house under the terms of the prenup - or whether she will get the proceeds of the property if it is sold as the will states: 'I intend by this will to dispose of all property wherever situated that I am entitled to dispose of by will.

'I direct the Executor of this Will and the Trustee of the Trust...to fulfill my obligations under that certain prenuptial agreement with Susan dated September 28, 2011.'

The Mrs Doubtfire star also owned a lavish Napa Valley estate, called Villa of Smiles, which is currently on the market for $29.9 million. Although there is 'significant interest' in the property, according to real estate sources.

Robin was married three times, first to Valerie Velardi from 1978-1988, then from Marsha Garces from 1989 to 2010 and finally to Susan.

He is believed to have paid his first two wives more than $30 million in combined divorce settlements, telling the Daily Telegraph in November 2011 just months after his third marriage, 'Ah yes, divorce, from the Latin word meaning to rip out a man’s genitals through his wallet.'

But he bore no ill will to his former wives, saying: 'I get on fabulously with my exes - now we’re not together any more. And they always appreciated my body hair, which was a plus, obviously.'

In the interview, he told how he met Susan in 2007 outside an Apple store, saying: 'We were both looking for weird technology and our eyes met.'

Asked about taking a third trip down the aisle, he laughed that given his track record, it was 'a bit like bringing a burn victim to a fireworks display.'

Beloved: Robin Williams with his two eldest children, Zachary and Zelda and ex-wife Marsha in 2006

On the market: Robin Williams' stunning Napa Valley estate, Villa Sorriso - Villa of Smiles - is selling for $29.9 million

Sprawling: Robin Williams' 20,000-square-foot home boasts five bedrooms, six full and five half bathrooms

Luxury: The Villa of Smiles even has its own private movie theater

Away from it all: The estate is more than 650 acres and has a winery and extensive views of the surrounding Sugarloaf Ridge State Park

According to legal documents filed by Robin, he first established a financial trust on December 26, 1989, after the birth of his son, Zachary 'Zak' Pym Williams, with first wife Valerie Velardi, and just months after the birth of Zelda, born on July 31, 1989, to his second wife, Marsha Garces.

It was originally filed as part of his divorce from Valerie and was meant to ensure that she would get alimony and child support in the event of his death.

By March 30, 2011, it was updated with a note that Valerie would no longer profit in the event of the star's death, as 'all spousal support obligations' had been satisfied, and that Zak would be the 'sole beneficiary' of that trust.

Zak was also 'entitled to distributions of principal in such amounts as the Trustees consider necessary for … support, education, and medical care.'

According to documents obtained by Radar, Williams established another trust covering all the children in December 2009, in the midst of his divorce from Marsha.

The full extent of that trust’s disbursement was planned to occur in stages: 'When the beneficiary reaches the age of 21 years … [they would receive] one third (1/3) of the principal.'

At 25, they would receive 'one half (1/2) of the remaining principal,” and at 30 they would receive 'the remaining trust property … outright.'

The trust was not dependent on Robin's death and so far, Zak, who is married to wife Catherine, is the only one of the children to have received all of his money after turning 30.

His fortune has been valued at $50 million by Celebrity Net Worth.

'Very difficult and emotional': Robin Williams found filming the scene in World's Greatest Dad hard. He played the father of a son who killed himself accidentally through auto-erotica

Home: Robin Williams was living with his third wife Susan Schneider at this house in Tilburon, CA. It's valued at $7 million and it's not yet known whether it will go on the market

In the months before his death, Robin had put his stunning Napa Valley estate, Villa Sorriso - Villa of Smiles - up for sale.

He had tried to sell the home in 2012 for $35 million but did not find any buyers, then in April this year he re-listed the home for the reduced price of $29.9 million.

He told Parade Magazine in September 2013: 'The idea of having a steady job is appealing...

'There are bills to pay. My life has downsized, in a good way. I'm selling the ranch up in Napa. I just can't afford it anymore.'

On Friday, the Coroner's court revealed that Robin did not have any illegal drugs or alcohol in his system when he committed suicide.

The report states the Mrs Doubtfire star - who had battled drink and drugs in the past - had four drugs in his system at the time of his death.

Toxicology reports found two anti-depressants and two caffeine compounds and there was no alcohol in his system.

When authorities found Robin's body, the reports states they saw a closed bottle of Seroquel, a drug that treats schizophrenia, bipolar disorders and depression. It was prescribed a week before he died.

Today, TMZ reported that the actor's suicide could have been triggered by a common but devastating form of dementia that may have disrupted his normal brain function.

Court documents obtained by TMZ reveal that Robin was suffering from dementia with Lewy bodies.

Sources connected with the troubled comic's family told the site that the degenerative disease was the 'key factor' they believe drove him to take his own life.

All smiles: Robin Williams and his only daughter Zelda at the Nickelodeon's Kids' Choice Awards in 2006

Robin was found dead in a bedroom at his Tiburon home.

Most poignantly, the Coroner's report states that his wife Susan wanted to see her husband's body before it was taken away, and that she was joined by Sheriff's deputies as she prayed over him.

She was also asked by authorities if her husband was interested in auto-erotica, which she said he was not.

But she added that he was left troubled by his work on his 2009 movie, World's Greatest Dad, in which his character's son died after hanging himself for sexual gratification.

The legendary comic battled paranoia, according to the report, and the night before he died, he placed several wristwatches in a sock and gave them to someone because he was worried about their safe keeping.

When asked about his behavior, Susan said he seemed well and had taken his iPad from their closet which she took to be a good sign because he hadn't watched TV or read anything in about six months.

The web browser had several tabs open to websites discussing medications, including Lyrica, an anti-seizure drug, and propranolol, which treats blood pressure and tremors.

Tragic: One of the last pictures Robin Williams posted on his Instagram account. Posing with Crystal the monkey, who had co-starred with him in the Night at the Musem films. Williams posed with his furry friend on his 63rd birthday on July 21, writing, “Happy Birthday to me! A visit from one of my favorite leading ladies, Crystal'

Heartbroken: Fans lay flowers as a tribute to Robin Williams outside his California home following his death

The couple were sleeping in separate bedrooms, Susan admitted, because Robin was having trouble sleeping and would talk loudly in his sleep.

The last time she saw him was around 10.30pm on August 11 and said he seemed 'excited'.

According to the report, Robin had experienced Parkinson's symptoms since 2011. He had a tremor in his left arm and movement in his left hand had slowed.

He had recently started taking Levodopa to treat the symptoms.