Should gun recoil be an animation or script?

Should recoil for a rapid fire gun be be done through an animation or a script? I want the recoil to increase as I continuously fire, like a lot of FPS games do.

I was initially considering achieving this through a script in unity that rotates the gun slightly each time I fire, but I realized that since I plan to have most rapid fire guns be 2 handed weapons, at some point, the left hand won’t be on the weapon.

However, since I want the recoil to increase as I fire, I’m not sure how to achieve this in an animation.

How is recoil typically done? Input on this would be very much appreciated.