My character has an animation when gravity affects him ("speed.y > 0"). but before I touch the ground, I want to press the down key in the air so that when I get to the ground, the sitting animation is done, but this animation does not happen, on the contrary the animation of when the gravity affects it is frozen.
thats my scrips:
func _move(delta):
if velocidad.y > 0:
$AnimatedSprite.play("Caer")
if is_on_floor():
if Input.is_action_just_pressed("ui_down"):
$AnimatedSprite.play("Sentandose")
yield ($AnimatedSprite, "animation_finished")
$AnimatedSprite.play("Sentado")