Can the IK constraint be only applied after the animation transforms?

I've been trying to make a Feet Placement Ik system with Two Bone IK constraints following a target that follows the feet's position after each animation pass. But I can't seem to figure out how disable the constrains weight before and enabling after each animation pass.
I've tried changing the weight values on the FixedUpdate to zero and OnAnimatorMove following the target and changed the weight to 1 but this appends:
5446872--555612--ezgif.com-video-to-gif (2).gif

 private void OnAnimatorMove()
    {
        rFootConst.weight = 1;
        lFootConst.weight = 1;

       (...changin target position to foot location)
    }

private void FixedUpdate()
    {
        rFootConst.weight = 0;
        lFootConst.weight = 0;
    }

The green rectangles are the IK targets and I presume the weight becomes zero before the constraint tries to blend the feet position with the IK target, any sugestions?

(Also I would like to suggest an option for the Two Bone IK Constraint to only follow certain axes, in this case i have would needed to follow the Y axis of the target)

Hi wafflesGama,

Animation Rigging is executed during the ProcessAnimation phase alongside FK animation. Therefore, you cannot use a callback to change constraint values in between FK animation and Animation Rigging (Refer to https://docs.unity3d.com/Manual/ExecutionOrder.html for a detailed look at Unity's evaluation order).

In order to control the weight value of your constraint, you should implement a custom contraint that will evaluate before your IK and write the weight value you intend the IK to have in the animation stream.

If you need help implementing constraints, have a look at the SIGGRAPH 2019 workshop we did last summer that covers the implementation of several custom constraints:

https://github.com/Unity-Technologies/animation-rigging-workshop-siggraph2019

1 Like

Thanks very much for the help! I've ended up making my custom constraint following only one axis. A long side with a script that follows the others axes foot a placed the target based on a raycast hit position. Like this :
https://www.facebook.com/102767007739059/posts/182053433143749/