Search Unity

ArgumentException: Input Button fire1 is not setup.

Discussion in 'Getting Started' started by badassgamer, Jun 26, 2015.

  1. badassgamer

    badassgamer

    Joined:
    Apr 26, 2015
    Posts:
    140
    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

    Code (JavaScript):
    1. #pragma strict
    2. var TheDammage : int = 50;
    3. var Distance : float;
    4. var MaxDistance : float = 1.5f;
    5. var TheMace : Transform;
    6. function Update (){
    7.      if(Input.GetButtonDown("fire1")){
    8.               //attackAnimation
    9.                    
    10.               TheMace.GetComponent(Animation).Play("attack");
    11.               //attack function
    12.               AttackDammage();
    13. }
    14. }
    15. function AttackDammage ()
    16. {
    17.      //Attack function
    18.     var hit : RaycastHit;
    19.      if (Physics.Raycast (TheMace.transform.position,TheMace.transform.TransformDirection(Vector3.forward), hit))
    20.      {
    21.          if(hit.distance < MaxDistance)
    22.          {
    23.             hit.transform.SendMessage("ApplyDammage", TheDammage, SendMessageOptions.DontRequireReceiver);
    24.          }
    25.      }
    26.      if (Input.GetKey (KeyCode.LeftShift))
    27.      {
    28.      TheMace.GetComponent(Animation).CrossFade("Sprint");
    29.      }
    30.      }
    31.    
     
  2. blizzy

    blizzy

    Joined:
    Apr 27, 2014
    Posts:
    775
    Did you look at Edit -> Project Settings -> Input to see what input axes are available to you?
     
    badassgamer likes this.
  3. badassgamer

    badassgamer

    Joined:
    Apr 26, 2015
    Posts:
    140
    its just says ctrl on fire 1
     
  4. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,860
    By default it is Fire1. Capitalisation is very important in programming.
     
  5. badassgamer

    badassgamer

    Joined:
    Apr 26, 2015
    Posts:
    140
    thanks it worked
     
  6. sStarS

    sStarS

    Joined:
    Mar 27, 2020
    Posts:
    19
    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
     
  7. WillSMashU

    WillSMashU

    Joined:
    Mar 18, 2021
    Posts:
    3
    This message saved me from going completely insane. This thread saved me.
     
  8. FerretGuy_

    FerretGuy_

    Joined:
    Apr 15, 2021
    Posts:
    2
    i capitalized it but it is still saying the same error message
     
  9. Vryken

    Vryken

    Joined:
    Jan 23, 2018
    Posts:
    2,106