Problem With Gun Reload Animation C#

So basically I am trying to animate a gun that I made in blender. I imported all of my animations and have them working. The only problem is that I am trying to animate the gun reloading on a GetKeyDown that I put under the void Update. Here is my code.

void Update{
    
    reloading = Input.GetKeyDown("r");
    
    if (reloading){
        
        animation.Play("Reload");
        
    }
    
}

So, that looks fine to me, but every time I hit the “R” key on my keyboard it starts the first few frames of the animation and then just stops it. I realize that it is because after it registers the KeyDown event it will make reloading no longer true since it already got the event and passed it, thus stopping its animation, but I don’t know how to fix that. Please help!

you could simply do this :

void Update{  
     
     if (Input.GetKeyDown("r")){//true as long as the key is down
         
         if(!animation.IsPlaying) animation.Play("Reload"); //so add a statement or it will try to play it several times at once.
         
     }
     
 }