Child of constraint

So I’m trying to switch constraints while doing a reload animation. I add one constraint from the mag to the gun so 1. The mag follows the gun. Then I switch the mag constraint from the gun to the hand so 2. The mag follows the hand now instead. Then I take the mag out of the gun, I put the mag back in and change the constraint again to the gun so 3. The mag follows the gun again. Simple right? Except now during the part of the animation where the mag is supposed to follow the hand, it doesn’t anymore. Why? How do I fix this?

Are you changing the target object on a single constraint?
If so, that’s not something that can be keyframed. Instead, add two constraints. One for the gun, and a second one for the hand.
You can set a key on the Influence value for the one that’s lowest in the modifier stack. With an influence of 1, it will override the constraint that’s above it. When you set it to zero, it will be ignored, and the first constraint will be in control instead.

1 Like

In addition to that you have to keyframe visual transforms

That’s what I’m doing, I have two seperate constraints for the mag.

  1. To the gun
  2. To the left hand

I switch influence as I take the mag out, put it back in, steady the gun back etc.

Except now during the part where I need the hand to pull out the mag, it just floats around instead of following the hand.

I’m still confused as to what visual transform is. Can you put it in simple terms for me?

It would probably work better using a Copy Transforms constraint instead.

Add an extra bone as a child of the hand, and set the mag constraint to target that child bone. That will give you more control over the position where it sits in the hand.

1 Like

It’s one of the stock keying sets, accessible from the keyframing menu (i by default). You should look up dynamic parenting on this forum, this has been covered many many times before.

A visual transform is basically how you apply a constraint, like you’d apply a modifier. It writes the final, constrained transform of the object to its transform fields. So you could do a visual transform on a child-of, and then delete the child-of, and the object would be right where it was when you began.

You can apply a visual transform from ctrl-a menu in pose or object mode. Constraint influences have a little “x” button next to them now that applies a visual transform then sets the influence of the constraint to 0 (not sure what it does in cases of multiple constraints, it’s probably not quite a full visual transform, but same thing.) And you can keyframe visual transforms directly, without ever applying them, with your keyframing ‘i’ menu, but I never do that (there used to be some bugs/weird behavior, and I just got in the habit of ctrl a, I don’t know if the bugs ever got worked out.)

1 Like