Hold jump to jump higher

Im wondering if it is possible to make the player jump higher if the player is holding the jump button, like in most patformers.

Below in the documentation is a sample code which implements holding a button to trigger something.


I think you could modify that to add velocity/impulse to the player to increase height while holding the jump button.

Try playing with gravityScale player property inside on space down and up events.