Idk how to force arm of my character to follow the mouse

‘’’
void Update()
{
Vector3 difference = Camera.main.ScreenToWorldPoint(Input.mousePosition);
float RotateZ = Mathf.Atan2(difference.x, difference.y) / 0.01744444444f;
transform.rotation = Quaternion.Euler(0f,0f,RotateZ);

}
‘’’
here is the code i was trying to force to work as i needed it to work, but i failed, I think it’s bcs my object(arm) consists of two parts: the part along the axis of which arm will rotate and the part that i want to follow the cursor. So i need help about how to make it work. Here is the screens of how it works now.

  1. cursor is ALWAYS right to the axis of the arm
    2)axis is in an empty object
    -
    the part of the arm that i want to point at the cursor(and the axis of the arm itself)
    i hope someone will help with the problem