ArgumentException: Input Button fire1 is not setup.

I got errors on console saying
“ArgumentException: Input Button fire1 is not setup.
To change the input settings use: Edit → Project Settings → Input
melee.Update () (at Assets/melee.js:9)”

but the melee worked normal before but now giving error here are my script = melee

#pragma strict
var TheDammage : int = 50;
var Distance : float;
var MaxDistance : float = 1.5f;
var TheMace : Transform;
function Update (){
     if(Input.GetButtonDown("fire1")){ 
              //attackAnimation
                   
              TheMace.GetComponent(Animation).Play("attack");
              //attack function
              AttackDammage();
}
}
function AttackDammage ()
{
     //Attack function
    var hit : RaycastHit;
     if (Physics.Raycast (TheMace.transform.position,TheMace.transform.TransformDirection(Vector3.forward), hit))
     {
         if(hit.distance < MaxDistance)
         {
            hit.transform.SendMessage("ApplyDammage", TheDammage, SendMessageOptions.DontRequireReceiver);
         }
     }
     if (Input.GetKey (KeyCode.LeftShift))
     {
     TheMace.GetComponent(Animation).CrossFade("Sprint");
     }
     }

Did you look at Edit → Project Settings → Input to see what input axes are available to you?

1 Like

its just says ctrl on fire 1

By default it is Fire1. Capitalisation is very important in programming.

6 Likes

thanks it worked

this is an old thread but is similar to my problem, i was testing my attack button so each tap on it would make the player lose 20 hp till 0, in editor everithing worked perfect i used “Fire1” on my phone however, the player kept losing hp every time i tapped the screen regardless if i was presing the joystick to move around or the touchfield to move the camera so do i need to use one of the other “Fire2,3” buttons instead of Fire1? cause on android device the whole screen is Fire1 aparently lol ( is ok if i dont get a suitable answer i can do it in other ways , i was just curious if that is the problem here? ) also after i changed a few things and tested a bit now even in editor every click drains the player hp lol it is a very weird thing haha

This message saved me from going completely insane. This thread saved me.

i capitalized it but it is still saying the same error message