I looked everywhere to try and find results for this, but found nothing that really matched ID Software's DOOM. But then I figured it out. Simply create a UI layer put in your gun sprite and give it 2 sine behaviors. One horizontal one vertical. Tweak them to your liking either really exaggerated, or quite subtle. Then set the wave period time for horizontal, and exactly half that for vertical so it will always bob up in the middle. Set conditions so if any of the W or A or S or D/^ or > or < or v are down set both sine behaviors enabled, then create a condition where if none of they keys are down to set both sine behaviors disabled. When done, you will have camera bobbing pretty almost exactly like DOOM's. :D
giphy.com/gifs/VwhnQURjx4yM2hk8Oo <-- GIF of DOOM camera bobbing.