- Home /
Input.ButtonDown and Input.getAxis same time pressed doesn't work?
Hello!
I want to fire bullets while my player is running. So I have to ask Input.GetAxis("Horizontal") and Input.GetButtonDown("Fire1") same time. If I press Fire1, the horizontal movement doesn't work.
2D sidescroller, Update Methode
Any help?
Comment
void Update()
{
velocity = Input.GetAxis("Horizontal") * speed;
if(Input.GetButtonDown("Fire1"))
{
//Instantiate bullet
}
}
If I press Fire1 AND change direction it doesn't work. no move unitl i press W or D again and stop pressing Fire 1 Is there a problem with pressing more than 1 key same time? The velocity is added to a characterController.$$anonymous$$ove $$anonymous$$ethod. Everything works fine. Only the double key press doesn't work.
WTF it works with Input.GetButtonDown("Fire1") and changed the key to e.g. "h". O$$anonymous$$G thank you! Who the fu** thought about such bugs? Jessy!!! The problem is solved!
Your answer