Increasing Variable Number Value?

I’m trying to figure out how to increase a variable number value whist pressing a key. Essentially I want the player to hold down a key (such as space) to steadily increase a number value in the blueprint. Then I want the number value to steadily decline back to 0 once the key is un-pressed. It would be great to have a peak number value as well.

I’m sure this is easy but I’m completely new to blueprints, so I’d appreciate the help.

Thanks

Hi,
I posting blueprint for you. In this ‘Count’ integer increase when you press the spacebar.

You would want to use the Event Tick (and the Delta Seconds) to increase it. You can use a “Gate” for this.

Plugin the Tick into the Gate and let the Gate be opened by a Key Press and closed by its Release.

Something like this?

http://puu.sh/h8tH3/5891965042.jpg

For decreasing we just flip the Pressed and Released and use a “minus float”. (make sure you plugin the variable in the upper input of the minus).

create a delay macro and do that

Thanks for the answers guys, ill get on it this week, and let you know how it goes!

And what if I am already using Event Tick in the blueprint? And I would like to be able to increase and decrease some value within the blueprint by pressing keys?