How do i make an equippable machine gun like mg42

Im remaking a game with a few of my friends, we are now at the stage, of trying too figure out how too recreate, When you walk up to a mounted machine gun an mg42 for instance, and mount th gun and shoot it/ How do i go abou t doing that, And ive seen videos with mg42 models, And they have a way of rotating the gun, im new too this so any info could help thanks