How to see if the player presses or holds a button

I’ve been making a Halo fan game, and I got up to creating the plasma pistol. When I tried to make the charge up shot, I got an alright result. The way it works is the gun fires after you release the trigger, which is alright, but it means when you spam the trigger, there’s a small delay to each of your shots. I was wondering if there was any way to accurately tell if the trigger was pressed or held to make the gun more responsive.

Assuming you’re using enhanced input, you use the ‘started’ pin to detect when the button is pressed, and ‘completed’ or ‘canceled’ pins for detecting a release, depending on circumstances.

It can get a bit complicated at times but that’s the standard way of doing it.

Here you can see the pins i’m talking about

image

You can control the required time for the button to be held to start doing whatever it is you want to do in the input action or input mapping settings. But like I said it can get a bit complicated, experiment with it.