The gun becomes invisible while running the game, how do I fix it?

The gun is visible in game view but not visible while running the game, this problem started occuring when I set the gun as the child of the main camera.