- Home /
Input.GetMouseButtonDown registering twice
Hi, I have a gun that instantiates a bullet upon left click, but it instantiates 2 times per click. Some answers show that putting it in Update causes this, so I moved it to FixedUpdate and still the same thing. Any help is appreciated.
EDIT:
Also, does anyone know how to stop the bullet in my game thats being instantiated because of the run game click? :)
Answer by Nick4 · Feb 21, 2015 at 01:15 AM
It has nothing to do with update functions, it's probably because you've attached the same script to 2 gameobjects.
Answer by Miki_505 · Apr 18, 2020 at 10:19 AM
Just for future readers I' m having the same issue. Reading input in Update (like GetButtonDown) causes double input read in FixedUpdate since in may be two fixed calls for one frame. Oddly not many people are mentioning that :/,
Your answer
![](https://koobas.hobune.stream/wayback/20220613183902im_/https://answers.unity.com/themes/thub/images/avi.jpg)