Please tell me how to get the player to memorize the position (left / right)? Let me explain what I mean: Let's say I want to shoot a potential enemy, I have a number of conditions for to make a shot: if (cursors.left.isDown) { bullet.body.velocity.x = -400; } else if (cursors.right.isDown) { bullet.body.velocity.x = 400; } else { bullet.body.velocity.x = 400; } Now if i turn left/right, my character begin to run in this direction Based on the above, it turns out that the bullet flies only in the direction in which I pressed the button (left or right). I would like that when you press the "left", my character has remained in this position until I press the "right" (or any other). Thank you, any ideas?