Micro FPS Tutorial Problem

I just finished the Micro FPS tutorial and uploaded the WebGL like it showed me…twice. And, both times, whenever I press the start button the gun auto-fires as soon as the game starts, and doesn’t stop. I uploaded it twice because I thought it might have been a compile or upload error, but since it’s doing it on the second upload, I have no idea what could be the problem. Does anyone have an idea what I could be? Below is a link to the game.

https://connect.unity.com/p/myfirstfpsgame-1

It’s hard to believe that no one has any input on this…i guess i should assume this is an isolated indecent. Really sucks cause i was almost proud of making this little game, even if it is insignificant.

I’ve just played your game three times and it worked as it should, i.e. the gun only fired when I pressed the left mouse button (no auto-firing).

Thank you very much. I feel slightly embarrassed now. But, with your feed back i found that it apparently has something to do with my Firefox browser. I was finally able to try it on a different PC, and as you’ve said, it works just fine…so, now i need to figure out what’s wrong with my browser…despite it being up-to-date. I guess it goes to show why games (or software in general) should be tested on more than one device.

well i tried your game but its black i cant see a thing. i left some comments but the gun was fine for me. even though I couldnt see it

mrpres_ident, I figured it out! I googled and found: Input.GetMouseButtonDown not working on WebGL build - Questions & Answers - Unity Discussions

I checked PlayerInputHandler in my own version of the FPS game and noticed on line 100 to 104:

bool isGamepad = Input.GetAxis(GameConstants.k_ButtonNameGamepadFire) != 0f;
            if (isGamepad)
            {
                return Input.GetAxis(GameConstants.k_ButtonNameGamepadFire) >= triggerAxisThreshold;
            }

So I disconnected a controller I had plugged in to my computer and tried to play your game again. Sure enough, the automatic firing stopped. I’m betting some gamepad types read the default ButtonNameGamepadFire control as not equaling 0f by default, and this caused the game to think “okay, well, the gamepad is firing. better keep firing!”

i didnt change anything. but these errors appear. anyone understand why?