"child of" bone constraind with ik? I'm animating a weapon for a game and ran into a little trouble that i don't know how to resolve.

What i want to do is have the left hand supporting the gun like a person would, but that hand is supposed to follow the weapon bone's every movement. Like as if the left hand bone were the child of the weapon bone, but it should also have an IK rig so that the entire arm moves realisticly aswell. But that does not work.

When i have both "child of" and "IK" modifiers, only the "child of" seems to be active. I thought that the hand would just be the child of the weapon bone the IK rig would move the arm like it should. But only the hand itself moves.

If i would move the hand manually to exactly where it should be, i wouldn't have this problem.

Does anyone know how i can fix this issue?

Below are two pictures, the first showing what i get when i use both ik rig and child of mofifiers, the second shows how it looks when i only have the IK modifier
So i eventually figured it out myself.

I duplicated my hand bones and called them IK_Hand_L/R.
the original hands follow those IK bones and the IK bone of the left hand is set as a child of the gun bone using bone constraints, which i can toggle on and off anytime i want.