• 2D
  • AnimatedSprite animation starts, but doesn't continue to play

I have problem with Jump and Fall animations, it only plays the next frames if I'm going somewhere. How to fix it?

extends KinematicBody2D

var velocity = Vector2()
const GRV = 20
const J = -350
const F = Vector2(0, -1)
var WAY = false



func _physics_process(_delta):
	if Input.is_action_pressed("ui_right"):
		velocity.x = 250
	elif Input.is_action_pressed("ui_left"):
		velocity.x = -250
	else:
		velocity.x = 0
	if Input.is_action_pressed("ui_up"):
		if WAY == true:
			velocity.y = J
			WAY = false
	if is_on_floor():
		WAY = true
	else:
		WAY = false
	
	velocity.y += GRV
	velocity = move_and_slide(velocity, F)
	
	
	
# warning-ignore:unused_argument
func _process(delta):
	if Input.is_action_pressed("ui_right"):
		if WAY == true:
			$AnimatedSprite.play("Run")
	elif Input.is_action_pressed("ui_left"):
		if WAY == true:
			$AnimatedSprite.play("Run")
	else:
		$AnimatedSprite.play("Idle")
	if velocity.y < -10:
		$AnimatedSprite.play("Jump")
	if velocity.y > 10:
		$AnimatedSprite.play("Fall")
	if Input.is_action_pressed("ui_right"):
		$AnimatedSprite.flip_h = false
	elif Input.is_action_pressed("ui_left"):
		$AnimatedSprite.flip_h = true

Welcome to the forums @EvilDoor!

You probably are overriding the jump and fall animations. You probably need to see if the character is grounded before changing to the run or idle animations using a condition like if is_on_floor():. For example, you could change your code in _process like the code below so it does not override the in-air animations:

if (is_on_floor()):
	if Input.is_action_pressed("ui_right"):
		if WAY == true:
			$AnimatedSprite.play("Run")
	elif Input.is_action_pressed("ui_left"):
		if WAY == true:
			$AnimatedSprite.play("Run")
	else:
		$AnimatedSprite.play("Idle")
else:
	if velocity.y < -10:
		$AnimatedSprite.play("Jump")
	else:
		$AnimatedSprite.play("Fall")

if (Input.is_action_pressed("ui_right"):
	$AnimatedSprite.flip_h = false
elif (Input.is_action_pressed("ui_left"):
	$AnimatedSprite.flip_h = true