How to make the camera lock and follow from behind the rolling ball

the camera rotation will not change if you hit something