Either you increase the size of the radius of the capsule or you can check for weapon block tutorials on youtube. The method uses linetraces/sphere traces to detect a hit and it will either play an animation for folding it sideways or use IK to pull the gun in a direction you specify. Try to check AngelV weapon block tutorial as it has the best logic for the sphere traces and wont have problems with jittery trace on an angle (other tutorials). It also uses true FPS character.