IK script doesn't do anything at all.

Hi.
As I’ve continued work on my third person shooter, I’ve been putting more and more of an effort in to polish things to make them look right.
The one aspect that I dislike the most is animations. One thing I want is for the protagonist to properly hold and operate the guns. For this reason, I’ve decided to create a basic script that, using IK makes the protagonist’s left hand stick to the gun’s foregrip, for example the shotgun while she’s pumping it or the slide of the underbarrel grenade launcher.

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

[RequireComponent(typeof(Animator))]
public class ForehandIKScript : MonoBehaviour
{
    protected Animator animator;
    public GameObject AnimatorHolder;
    //public Transform LeftHand;
    public Transform Foregrip;
    public Vector3 PositionOffset;
    public bool HoldingGun;
   
    // Start is called before the first frame update
    void Start()
    {
        animator=AnimatorHolder.GetComponent<Animator>();
    }

    void FixedUpdate()
    {
        //LeftHand.transform.position = Foregrip.transform.position;
    }

    // Update is called once per frame
    void OnAnimatorIK()
    {
        if (animator)
        {
            if (HoldingGun == true)
            {
                animator.SetIKPositionWeight(AvatarIKGoal.LeftHand, 1);
                animator.SetIKRotationWeight(AvatarIKGoal.LeftHand, 1);
                animator.SetIKPosition(AvatarIKGoal.LeftHand, Foregrip.position+PositionOffset);
                animator.SetIKRotation(AvatarIKGoal.LeftHand, Foregrip.rotation);
            }
            else
            {
                animator.SetIKPositionWeight(AvatarIKGoal.LeftHand, 0);
                animator.SetIKRotationWeight(AvatarIKGoal.LeftHand, 0);

            }
        }


    }
}

The problem is that the script currently does… absolutely nothing.

Just to clarify… I HAVE enabled IK on the appropriate animation layer.

I dont know the problem, but this video is very comprehensive about the subject.