There's a video on youtube called something like "The Truth about Robin Williams" that is pretty good if you have the time and interest to watch it. I can relate to Robin Williams I think.
Basically, from everything I have gathered, Robin was always playing a character trying to make people laugh. He didn't have any real friends who knew him well outside his persona. Furthermore, because he had been living like this pretty much his whole life (he was picked on as a child and learned to be funny as a defense mechanism), he probably didn't really know how to be a normal person and just talk and share time with people without always trying to make them laugh. I've watched lengthy interviews with him where the interviewer tries to get serious, and Robin just seems incapable of giving serious replies longer than 30 seconds without then making a joke or something. Beyond this, he had two failed marriages. I'm sure he felt very isolated, which is a huge cause of depression and suicide.
Robin had also been a drug and alcohol addict a big share of his life, which obviously goes hand in hand with depression and mental health. I'm not saying one causes the other or anything, just that it's an indication he wasn't super happy even long ago (really happy people generally don't turn to drugs and alcohol abuse).
Being diagnosed with Parkinson's was probably what drove him over the edge, but we don't really know.
Through his suicide I've realized a lot of people don't understand depression. It's not like people choose it, nor does it come from stupid things like being bored. It CAN be caused by chemical imbalances, but it can also come from supreme loneliness, a serious loss (like loved ones or the ability to continue living life as you like it), or even just feeling like there's nothing really to live for. Usually the feelings pass, but some people struggle with depression their whole life and can't seem to shake it no matter what they do. In most cases I think we should withhold judgement as it's impossible to know what life was like for someone like Robin Williams. How does anyone know what life is like for someone else simply by viewing them from the outside? You don't know what was going on inside their head or what they were feeling. Without living their life and having their experiences, you don't know.
It's a shame Robin Williams killed himself, and a real tragedy for his family. I am still upset about it myself. I've taken pleasure in re-watching some of his movies and appreciating that he was easily the most popular and loved comedian of the last 35 years. There's really no one else like him.