Because I'm dumb and didn't realize springs exist.
Basically I was sad that you can't change the width of the barrel walls of the cannon, so when building naval turrets they definitely look too thin so my recent turrets had no recoil because I shrouded them inside a hollow fuselage, then I thought putting a spring behind the barrel would solve my problem and it did.