OnAnimatorIK Help

Okay so I can’t believe I’m hung up on this but I have read every thread out there and I can’t seem to figure out why OnAnimatorIK is not being called.

I have a character which already has basic movement animations. I created an IK script and put it on the same gameobject the animator is. I then checked the IK pass box in the layer( there is only one layer right now). When I debug, my OnAnimatorIK never get’s called.

Please any insight as to what I’m missing because I seem to be failing to find it.

Here is the code for my IKHandling

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class IKHandling : MonoBehaviour {

    private Animator Animator;

    public float IKWeight;

    public Transform LeftIKTarget;
    public Transform RightIKTarget;

    public Transform HintLeft;
    public Transform HintRight;

    private void Start()
    {
        Animator = GetComponent<Animator>();
    }
    private void OnAnimatorIK(int layerIndex)
    {
        Animator.SetIKPositionWeight(AvatarIKGoal.LeftHand, IKWeight);
        Animator.SetIKPositionWeight(AvatarIKGoal.RightHand, IKWeight);

        Animator.SetIKPosition(AvatarIKGoal.LeftHand, LeftIKTarget.position);
        Animator.SetIKPosition(AvatarIKGoal.RightHand, RightIKTarget.position);

        Animator.SetIKHintPositionWeight(AvatarIKHint.LeftElbow, IKWeight);
        Animator.SetIKHintPositionWeight(AvatarIKHint.RightElbow, IKWeight);

        Animator.SetIKHintPosition(AvatarIKHint.LeftElbow, HintLeft.position);
        Animator.SetIKHintPosition(AvatarIKHint.RightElbow, HintRight.position);
    }
}

Just figured out my problem. It was that my rig & animation clips were not set to humanoid.

@ADAMN721: Thanks for the hint where to look, I solved it now different (with Unity 2019.4: )
in the Animator, Layers, Layer → Options/Settings : marked the “IK Pass” and it works.

I also had the same problem and nothing worked for me and I finally realized the script MUST be on the same object that the Animator component is attached to or it will not be called.