Several video games use a system to jump a few frames after a fall so that the gameplay is more comfortable and fair, in this case, I am trying how to do it, I don't know what to call it so I didn't find an answer, does anyone know? Anyway, this is the code that has to do with it.
extends CharacterBody2D
const JUMP_VELOCITYV = -400
var gravity = 1000
func _physics_process(delta):
if not is_on_floor():
velocity.y += gravity * delta
if Input.is_action_just_pressed("Jump") and is_on_floor():
velocity.y = JUMP_VELOCITY