Every time I press the jump key, the character jumps as expected. However, the character continues to ascend even after the key has been released. Any way to fix this?
Develop games in your browser. Powerful, performant & highly capable.
The way I do it is start with a low jump strength and when the jump button is pressed the players gravity gets set to something lower and when you release it you set the gravity higher. You can get a lot of control out of your jumps this way you just need to play with it a bit. You can also tie this into a jump sound effect where you use a longer or repeating sound effect and play it when the jump is pressed and stop it (use a sound tag) when you release the button.
You can also do this:
if button is [not] down && object.jumping
-> set object.vectorY = object.vectorY/2
This will, as long as your character is jumping, halve it's Y speed every tick.