How can set the player holding gun not pass through the object?

As the picture the gun pass through the container, how can make it not pass through the container such as some collision?
I have finished all the Testing Ground lectures.
Many thanks.