.Play() Ignoring if statement

Hi all, Unity newbie here even i’f im coding for almost 2 years, this is why i need your help because i’m running into a problem that make no sense to me, i’ll try to explain as better as i can, sorry for my english.

I’m working on a function that let my player throw a grenade, i have a grenade prefab and this code:

    public float speed = 10f;
    public Rigidbody nade;
    // Start is called before the first frame update
    void Start()
    {
       nade.velocity = transform.forward * speed;
    }

And an empty game object children of the player, near to his hand wich works as a reference point to where the grande start Insantiating, here’s the scritp:

public class GrenadePoint : MonoBehaviour
{

    public GameObject rifle;
    public GameObject grenade;
    public Transform grenadePos;
    private int grenadecount = 3;
    public Animator playerAnimator;
    private bool isThrowing = false;

    // Update is called once per frame
    void Update()
    {
        GrenadeAnim();
    }

    public void ThrowGrenade()//This function is being called by the Animation, as an animation event.
    {
        Debug.Log(grenadecount);
        if (grenadecount > 0)
        {
            grenadecount--;
            isThrowing = true;
            Instantiate(grenade, grenadePos.position, grenadePos.rotation);
        }
    }

    public void GrenadeAnim()
    {
        if (Input.GetKeyDown(KeyCode.G))
        {
            Debug.Log(grenadecount);
            Debug.Log(isThrowing);
            if (grenadecount > 0 && !isThrowing)
            {
 
                rifle.SetActive(false);
                playerAnimator.Play("My_Grenade_Throw");
 //Once this fired, the player will start his animation, wich is going to call the ThrowGreande

            }
        }
    }

    public void ResetGrenades()
    {
        playerAnimator.Play("Rifle Aiming Idle");
        rifle.SetActive(true);
        isThrowing = false;
    }
}

Let me explain, the animation for throwing the grande is a classic one, i want to throw the grande not exactly when it starts but at certain point, trying to be as realistic as possible, i so added an animation event on the frame i want to call the ThrowGrenade() function.
Fun thing, everything is working fine.
When i press G the player start his animation, when the event call the function, the nade Instantiate, it looks like his throwing it, at the end of the animation, i added another event to reset some variables.
The grenadecount is decreasing correctly, the animations are resetting correctly, and my bool isThrowing is working fine, since i don’t want the function to be call in the middle of the animation.
The problem start after i’m out of nades, and this if statement is being ignored:

if (Input.GetKeyDown(KeyCode.G))
        {
            Debug.Log(grenadecount);
            Debug.Log(isThrowing);
            if (grenadecount > 0 && !isThrowing)
            {
           
                rifle.SetActive(false);
                playerAnimator.Play("My_Grenade_Throw");
            }
       
        }

I tried to do every kind of checks, what i want to do is if i have 0 grenades, i don’t want the animation to be called at all, but no matter what, even if i have 0 grandes and i press G the player will start his animation (Wich is inside an if statement that should return false), once the animation start the function Throwgrenade will trigger but not insanting anything, so the greande count is working, i’m going nuts and my code looks like spaghetti because i can’t figure out how to not call this line " playerAnimator.Play(“My_Grenade_Throw”); "
But no matter how many controls i do, the if will be ignored and the animation will start playing.

I know this might not be the right thing to do, and i will probably rewrite everything from scratch, but at this point i’m curious on why the IF statement is being completely ignored.
Thank you in advance, if you need more info feel free to ask everything

P.S: I noticed this might not be the correct section of the forum, sorry about that. Move this topic if needed

Are you sure no other code in your project is reacting to KeyCode.G presses? I’ve previously written test code to do an animation, then walked away from that part of the code for a month, come back and made the “real” script to control the animation, and forgot that my initial test script was still in there reacting to the same key press when I didn’t expect it to.