How to make an object (arms/gun) face towards mouse?

I want an object to rotate towards the mouse, but at the same time stay centered so it stays connected to the player model (seperate object). I tried making the camera (that already aims towards the mouse axis) their parent, but the rotation wasn’t centered and the arms/gun moved away from the body if I looked up or down too much. Is there a simple way to make objects aim using the mouse values?