Unity does not recognize reload animation for gun

I am trying to make a reload script for my gun, so that when I hit ‘R’ my gun reloads, but the thing is that the animation and the reseting of current ammo doesn’t work. What’s the problem here?

var SMG : GameObject;
var smg_script : MonoScript;
var Ammo = 54;
var CurrentAmmo = 54;
var Wait : float;

function Update () {


   CurrentAmmo -= 1;

  if(CurrentAmmo == 0){
     if(CurrentAmmo < 54){


function Reload () {


yield WaitForSeconds(Wait);
CurrentAmmo = 54;


Your second if statement is nested in the first. It will be easier to see if you adjust your tabbing.

Your code looks like this at the moment.

if(button) {
    if(ammo) {

    } else if(button2) {


For the second button to be checked, you need to hold down the first one (which I assume is not what you’re expecting)