Realistic FPP camera

The simplest way to achieve what your wanting is to add head bob to the character skeleton. Add a socket to the head node and attach your spring arm/camera to the socket. This way you have control of how the head bob works and when it’s applied through your animation assets without additional coding.

You can achieve it through other methods but youll have to manage the effect alot more as your character switches animations during transitions such as walking to running, going prone, zooming in, etc. By handling it your animations assets each character can have unique head bob and each animation with have it’s own also, giving you complete control of how and when it’s applied.