My weapon is going into the wall

Hi, I’m doing a first Person Shooter game, everything is going very well, but there is a problem. My weapon is going into the wall. The solution of this is actually simple by shooting back with animation, but I want it to appear directly from inside the wall. you’ll make me very happy if you explain in detail how to do this!

You can put a collision sphere in the end of the weapon to stop this happening.