I don't know how to make the player jump (like the blue soul in Undetale).Can you help me, please?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Aqiurys

For those who don’t know how is the blue soul jumping.As long as you hold the arrow key, the body’s jump height is bigger, until it reaches the max jump height.Please help me.(English is not my first language so if what I have just said doesn’t make any sense, sorry.)

Yeah sure, can you tell in detail.

RedStone-007 | 2020-08-31 15:26

can you share your current code?

p7f | 2020-08-31 16:57

:bust_in_silhouette: Reply From: ArthurER

the most common way I have seen to stop jump/flying is to only allow a jump to occur if the player is on the floor.

If Input. is_action_just_pressed and is_on_floor():
    velocity.y = jump_speed

I think he is not asking that. The way you provided will always jump the same ammount. He wants the player to jump higher if the button is kept pressed. If the button is released before reaching max height, the character should start to fall anyways.

Also, you forgot the : at the end of the if statement.

p7f | 2020-08-31 16:59