Copy/Paste IK bone relative position ?

Hi guys, i need to do the following. I am doing a forward walking animation for a game character using root motion. Now if i move the root of the object to the destination position i would like to have all the IK bones matching the relative position to the root bone ( note : they are not connected to it ) in order to do a seamless loop animation. Is there any script or a way to match an IK bone position for different frames…

Here is another (old) thread but hasn’t been answered:

There are a couple of cheats we can use but it’s a kind of annoying and time consuming process.

Currently the way i am working is to have a ChildOf constraint to added to the IK bone which i am enabling temporarily in order to get the needed destination position.
Another way is to attach empty objects to the root and this way when it moves they will move with it and we will have the referenced position for the IK bones.

Thank You !

I don’t know if I understand. For a root bone to truly be a root bone, everything must be children of it. So, the IK targets should move with the root bone. In the thread that you linked to, the original poster wanted the feet targets relative to the body, not to the root.

The root bone is a parent to all the “deform” bones which is what a game engine cares about when using root motion animations… The IK bones are part of the rig and actually serve to control it and are not exported to the game engine. If they were connected to the root bone how i would have a leg or an arm staying in place while moving a character body let’s say for a walk cycle animation… Both root and ik bones are part of the armature and i simply would want to be able to select the root and the ik bones and copy the delta distance between them and then at the next pose to paste the ik regarding the root bone position… In my opinion this would be really helpful in some situations :slight_smile: !

I have no experience with game engines. But, acceptable rigging practices in animation demand that everything be in the root bone child heiarchy. And, I believe these guidelines also apply to rigged controls for animations that will ultimately be baked to a deformation armature for export. Because you are only baking the resulting deformation bones, the game engine does not care how the animation is ultimately achieved.

To achieve the result that you are wanting, I suggest the method that would be used in animation. If you want an IK target to stay in position relative to the world, have the IK target copy the location (or be a temporary child) of a target object in the environment. If you want it to move with the root, that will happen automatically. Having an IK target stay in place while the root bone moves would be an enormous pain, and those situations would be far fewer than situations where you want the IK targets to move with the root bone.

Copying the deltas as you request would have multiple technical issues, both for implementation and in practical use.

If you asked about something specific that you are trying to do, helping you would be easier.

Can’t tell how you rigged this without a least a blend with the armature. What you are trying to do? However, Normally I parent the IK control bones to a socket bone located with the thigh bone which is then parented through the chain to root. Take a look at a generated rigify rig and follow the IK chain the the foot is parented to down to root. That should work for you. You can then move every thing but root for your walk cycle and then move root using a constant interpolation movement.