sorry for the late response, i had to stop programming for a while.
I had to rewrite your code for me to work.
if input_vector.x != 0 and is_on_floor():
animplay.play("run")
elif vel.y != 0:
if Input.is_action_pressed("up"):
animplay.play("jump")
if Input.is_action_just_released("up"):
animplay.animation = "jump"
animplay.frame = 6
and i decided to change a little the beginnning of the old code i gave here.(your code is in the end)
if input_vector.x == 0:
apply_friction()
else:
apply_accel(input_vector.x)
if input_vector.x < 0:
animplay.flip_h = true
elif input_vector.x > 0:
animplay.flip_h = false
if is_on_floor():
if Input.is_action_pressed("up"):
vel.y = jump_force
else:
if Input.is_action_just_released("up") and vel.y < jump_release:
vel.y = jump_release
if vel.y > 0:
vel.y += additional_fall_gravity
var was_in_air = not is_on_floor()
vel = move_and_slide(vel, Vector2.UP)
if input_vector.x != 0 and is_on_floor():
animplay.play("run")
elif vel.y != 0:
if Input.is_action_pressed("up"):
animplay.play("jump")
if Input.is_action_just_released("up"):
animplay.animation = "jump"
animplay.frame = 6
else:
animplay.play("idle")
i can clearly say that my code has no sense, and is very painful to read lol, but in the end it worked, so thnks for your help.