Blueprint, increase float value when pressing on a key

Hi, I’m new to the blueprint system and I’m trying to do this simple stuff but I don’t know how to do it.
Basically I have a float value and what I want is when a press a specific key, this value increase as long as a keep pressing the key and when I release, the value stop increasing.
I seem pretty simple but I didn’t find a way of doing that

1 Like

Try this:

Thanks it work ! and do you know how can I limited the value between a specific range. Like for example, the value is between 5 and 10 and it can’t go bigger than 10 even if you keep pressing the key.

And also is there a may to decrease the value when you press a different key ?

You have min and max nodes you can use, or clamp if you want to do both at once.

As for how to subtract instead of adding, not to be a jerk, but I think you’ll figure it out if you spend 20 seconds looking at the blueprint you copied.

1 Like

Use a Clamp node before setting a value.

And also is there a may to decrease

Subtract instead of adding.