Is there a way to trigger a command when a key is lifted?

I'm currently in the midst of remaking the NES Super Mario Brothers, and although I have found answers to nearly everything I needed, this one I seem to be stuck on.

When I make Mario sprint, I want his speed to increase gradually, and when a key is lifted I'd like the speed to decrease gradually. Decreasing is my problem because I couldn't make a make-shift trigger for when a key is lifted.

I'm doing as a passion project, and I want it to be as a accurate as possible, thank you for any help you'd be able to provide

Side note: I'd need the "when key lifted" type block directly under the "When key pressed"

Does this help you?

untitled script pic - 2023-09-16T133704.154

Trying to use this made me realise how unfamiliar I am with the "Say" command lol. How do I make something pick up on that?

I may have not accounted for certain things. I need them to trigger for a short period of time only to slow down the player, and I also need them not to interfere with the other inputs, like jumping. Any other ideas?

If you publish your project, it'll be a lot easier to help you out as we can then see all that is going on :slight_smile:

Alright, but a heads up, it has a lot going on. Just ask if you want to know where something is, or what something does.

OK :slight_smile:

What key are you using to sprint?
Ignore that

I see that you have this to move left/right

I can't see any increasing going on

What you need to do is basically change your horizontal movement so that its like your vertical movement - e.g. has acceleration in it rather than just scroll a fixed number of units

Regardless - hopefully some of the Snappers that have written things like this will be come along to give some proper advice :slight_smile: