How to fix ( ArgumentException: Input Button fire 1 is not setup)
I'm making a puzzle game with some fps elements so I made a gun recoil animation, and I think I made the script correctly. I parented it to the M9 and and added audio with the animation, but now it says there is no Input. So set the input to mouse 1 (I think that's left click) and it still gives me this error any ideas?
Script is here
function Update () { if(Input.GetButtonDown("fire1")){ var gunsound : AudioSource = GetComponent.(); gunsound.Play(); GetComponent.().Play("GunShot"); } }
Answer by TrueMaskss786 · Aug 06, 2016 at 06:05 AM
I think the issue is case sensitive The input name given in code is 'fire1' and in input manager it is 'Fire1'. so try changing this, it should work properly
if(Input.GetButtonDown("Fire1"))
Your answer
Follow this Question
Related Questions
Help With Recoil Script 0 Answers
How can I animate the trigger and hammer of a gun? 1 Answer
Gunshot not working? 0 Answers