As others have pointed out, it's starting (well, it's been so for a long time, just not to everyone) to become obvious that so many of these incidents relate to the mental health of those involved. The guy in OKC who goes crazy on the bus being a rather stark example.
BTW, for some context..... the number of police officers killed by gunfire in 1967, was 87. Given the population of the US at the time, on a per capita basis, that would be equal to 130 LEO officers killed by gunfire per year now. Fortunately, we are way below that number, with only 37 officers killed by gunfire last year, and 32 so far this year.
Obviously, bullet proof vests and better technology have helped drop that number. But still, when you look at comparable crime rates, etc. we are still as safe or safer than we have been in over 50 yrs.
For mental health issues, look at the guy in Nice who took the truck and committed such a heinous act. Turns out, his family had been trying to get him mental health treatment for a decade. Dude was a gay hustler who turned tricks routinelywith a long list of clients, drank heavily, ate pork, and never went to mosque-hardly the signs of a devout muslim.... but when taken into context with what else we know about him, he did have a lot of signs pointing to "head case."