In your code:
var is_jump_interrupted: = Input.is_action_just_pressed("jump") and velocity.y < 0.0
Means that if you press W you will jump, and if you press it again (in mid-air) it cancels the jump.
If you want to make a small jump, (like in the video) you have to change it to:
var is_jump_interrupted : bool = Input.is_action_just_released("jump") and _velocity.y < 0.0
Because you want to cancel the jumping if you release the jump button not when you try to jump again.
(the bool is not need, but i like to put the type of the variable in my code, you can just write := )
Thank you very much for the reply and help. I see this message is from March 7 - I normally reply to everyone, but I missed this one somehow.
You can write another answer or message me directly if I don't get back to you within a few weekdays - it means I either didn't get or I missed the notification.
Change your function from:
func get_direction() -> Vector2:
return Vector2(
Input.get_action_strength("move_right") - Input.get_action_strength("move_left"),
-1.0 if Input.is_action_just_pressed("jump") and is_on_floor() else 0.0
)
to:
func get_direction() -> Vector2:
return Vector2(
Input.get_action_strength("move_right") - Input.get_action_strength("move_left"),
-1.0 if Input.is_action_just_pressed("jump") and is_on_floor() else 1.0
)