Gun goes through a wall

Hey, guys! I have a problem with my fps game. I have a gun parents to the camera. When I go near a wall, the gun mesh goes through the wall. Can u help me solve this problem. Thx in advance!

There are a couple of solutions:

  1. Set up another camera that only sees the weapon and render it on top of your Main Camera. *
  2. Write your own shader that renders on top of everything else. *
  3. Implement a behavior (via scripting) for the weapon when it collides with an object, typical solutions is that the character aim upwards or sideways.

*Will make the gun look small when standing right in front of the wall.