Before leaping to blaming the guns or associated laws, bear in mind that half his victims (3 of the 6 he murdered) were actually stabbed, not shot - the media seem to have latched on to one of his two chosen weapons, calling him "the gunman" etc. (Also, 4 of the 6 murder victims were male - another bit that seems overlooked.)

If "gun laws" are the source of the problem, how are "knife laws" any less culpable since half the murders were stabbings? Of course, the lousy spoilt upbringing and sense of entitlement must have been a large part; his writings make it obvious he had a big chip on his shoulder about race ("Full Asian men are disgustingly ugly and white girls would never go for you", "How could an inferior, ugly black boy be able to get a white girl and not me? I am beautiful, and I am half white myself. I am descended from British aristocracy. He is descended from slaves") - he'd previously assaulted at least two groups of people, as well as getting in some sort of fight at a party.

So, there were warning signs there, and indeed the police had considered getting him detained on mental health grounds, but decided there wasn't enough evidence to do so (and have now suspended the officers who made that decision, pending the investigation). No, he was never formally diagnosed - but then, he wasn't formally assessed either, because the police never took him in for assessment. (I don't know about CA, but here, the police would be expected to take him to a secure psychiatric facility, where he'd be properly assessed and diagnosed by psychiatrists; I get the impression CA is similar there.) If they had, I suspect he'd have been diagnosed and detained, from what has been reported so far.