Animations Stuck replaying? Overriding Solution.

So I have been at this for HOURS today… I have tried this, tried that, read this watched that, my god… FRIED IS NOT THE WORD TO DESCRIBE!! ;).

Anyways… Ill post my code here for sure, in hopes that you guys can point out what the heck im doing wrong here? But nonetheless, implemented kinda a BURTE/Primitive alternative which worked perfectly.

So What I did to override this. Was implement a Courotine with an IEnbumerator. Delaying the command of forcing the animation to stop by 2 seconds;

Note The “Override” IEnumerator is what my primitive work around was. Id prefer not to do it this way…

As well the If statement That should prevent this animation from replaying as it does… BUt doesnt? :

Any insight or constructive criticism is appreciated!

Enemy AI:
------------- CODE BELOW

private void Die()
        if(isDead) return;

        isDead = true;
        // GetComponent<Animator>().enabled = false;

    IEnumerator OverRideAnimation()
        yield return new WaitForSeconds(2); // Delay for 2 seconds
        GetComponent<Animator>().enabled = false; 


You can stop an animation looping by selecting it in the project pane and toggling loop time off in the inspector.