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.

https://docs.coregames.com/api/camera/#isdistanceadjustable

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.