Gun goes through walls (FPS)

Hey, i recently started working on a First Person Shooter. I added the FPController and added a shooting gun. The only problem i still have, is that my gun can go through walls. I tried the different layers/cameras method but i dont know for sure if it works in unity 5 or i just did something wrong.

So how can i fix this problem?
(working in unity 5 personal)

Thanks,

me

You place the gun in its own layer, and you create a camera that only renders the guns.
Then you change that camera’s depth number to something higher than the main camera’s.