How to make objects connected through sockets invisible to owner?

Hello. So I am making a first person shooter and just figured out how to make the third person model invisible, but the gun that is connected to it via sockets is just floating through the air and doesn’t turn invisible. Any one know why this is happening? Sorry if this is a noob question btw. Im not very good with animations.