in this video we are going to fix your fps objects so it doesn't clip into the walls anymore. In #unity 00:00 Preview 00:14 Layer 00:34 Camera 01:08 Result
No, this is not a solution, and people should stop recommending this The moment you do this, your weapon no longer is lit by the environment and will always have the default lighting applied Ergo, you LOSE everything that makes the weapon feel part of the world, just so it doesn't clip through a wall The proper way to do this is through creating a custom shader for the materials on the weapon to always be rendered on top (difficult), or to move the weapon out of the way (upwards for instance) when you're close to a wall via a raycast check (easy to do)
That's not a good solution, you would probably want to do smth else with this. Why is this bad? Cause u don't see clipping, but it happens. Imagine that now u may want to shoot enemy at close range, but weapon will fall into enemy collider and your shots won't be registered, cause bullet collision doesn't work from inside of enemy collider.
a thing not shown in the video but that I had to do. In your second camera go to Camera -> Render Type -> Overlay, and your main camera: Camera -> Stack -> + -> your second camera. It worked this way for me