Cant figure out how to make arms rotate toward cursor

Ive been trying to make this effect in my gun system where my characters arms rotate up and down based on the position of the cursor, but I cant seem to get it to work right. I tried to do it by making a part in the middle of the character which I then attached the characters arms to, however, whenever I change the DesiredAngle of the Motor6D that attaches the part to the torso, it just kinda rotates the joint part around a certain point and makes the arms detach weirdly. Is this even an optimal technique? Should i just stick to changing the C0 (which i dont really know how to use that either) or go with this?

Example of issue (grey part is joint part)
Screenshot 2021-06-27 203352