Download

How to "disable" Key Pressed-Node

Hello Unreal Engine Community,

I’ve been working on a FPS-Game for some time now and I was wondering: Would there be a way to disable the Key Pressed-Node?
For example: I have a Fire function, if you press the key and keep it pressed, there is no way to turn the Fire-function off.
Anyone have some advice?

(Sorry for my bad english, I’m german)

How is your set-up right now? Guessing you already have a REPEAT spawner that’s handling the firing, otherwise inputs are generally a one shot event (no repeat firing). So you must have a projectile spawner running in a loop somewhere? As regards solutions, there’s lots. A common approach is to use a looped Timer, which can then be cancelled by invalidating the timer or handle.

The timer code can be placed after the InputAction (Pressed event). But you can also just use a Gate (or **Bool **/ Branch) after the InputAction (Pressed) event too. Then drag a wire from there and loop it back on itself to shut-off the Gate after X seconds. Or drag a wire to the InputAction (Released) event code to stop firing, so that the player has to release the button and then press it again…

Thank you, it worked!