Camera Animation

I have noticed that in most modern fps games the camera moves automatically when an animation is playing, such as if the gun is shooting the camera looks up a bit and then back to normal when the shooting has stopped. I haven’t a clue what so ever on how to do this I have looked for tutorials but nothing seems to come up, can anyone help me out?

How to detect those events probably don’t matter here. How to animate the camera then ? Plenty of ways. An animation from Unity (rotation in your example), or a coroutine with a Transform modification (Translate, Rotate, Lerp etc). Well, that’s not as much as I thought …