FPS Gun Movement/Rotation (Tiny Problem)

So, as you can probably tell, my gun seems to be rotating locally. The guns movement is dependent upon my mouse look script, and a gun script that smooths the movement to the cameras rotation. I’m trying to achieve a COD/BF4 style, where the gun rotates with the camera “Globally”. Any help would be greatly appreciated. Thank you for your time.

P.S. Sorry if this is the wrong place to post this, I wasn’t sure since it’s kind of specific and I thought it Physics vaguely covers the rotation and positioning of objects.

Your pivot is probably off, but if you’re going for a CoD style then place the gun as a child of the camera, and problem solved.

Not quite CoD style. Just similar. All I want is where the gun stays straight in line with the camera on the x-axis, so when you look whilst aiming, it stays in line with the camera. But thanks for the advice, I may take a different approach, but I’ll keep working on this.

Is there a way to do this through scripting? I want to avoid making the gun a child of the camera. It creates issues in the development streamline.