Cant get gun to rotate with camera!!!

Using standard asses ‘FPS Contoller’ where the camera is a component not its own object.The gun attached to the controller follows rotation in y axis (left and right) but the gun does not follow pitch.(x axis)

Ive tried applying
void Update ()
{
gameObject.transform.localRotation = cam.localRotation;
}
to the gun where cam is a reference to the camera component but no luck!!! Any help would be greatly appreciated!!

https://drive.google.com/open?id=0B-ciTM6GffrkMk1VeUtYZ0dIWHM video that shows what i mean(you can see the gun does not track the cameras pitch)

Hey,
It looks like you have attached to de player object.
Drag the gun beneed the camera and it should follow the camera.