Hi my jumping script is not working I can jump infinitly

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Thenejo
    func jump(delta):
if Input.is_action_just_pressed("Jump") and is_on_floor():
	jump_timer = current_jump_time
	is_adding_jump_force=true
	
if current_jump_time<0 or Input.is_action_just_released("Jump"):
	is_adding_jump_force=false
	jump_timer=0
	
jump_timer-=delta

if Input.is_action_pressed("Jump") and is_adding_jump_force:
	velocity.y=-current_jump_height*delta


func gravity(delta):
if not is_on_floor():
	velocity.y+=current_gravity*delta
if is_on_floor():
	velocity.y=0

 func _physics_process(delta):
    gravity(delta)
    jump(delta)
    move_and_slide(velocity,Vector2.UP)

Jump Time is going below zero but it doesn´t make is_adding_jump_force false

:bust_in_silhouette: Reply From: Jayman2000

I got it to work by changing

if current_jump_time<0

to

if jump_timer<0