Animation Sprite not working only for one animation but working for the rest

The walk left animation is not working but the walk right and stand animations are working i dont know what is going on can sobebody help? Animations are made in animated sprite
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
if Input.is_action_pressed("Left"):
	position.x -= speed
	if is_on_floor():
		animation.play("Walk Left")
if Input.is_action_pressed("Right"):
	position.x += speed
	if is_on_floor():
		animation.play("Walk Right")
else:
	if is_on_floor():
		animation.play("Stand")
move_and_slide()

Try using an elif to sequence if statements together

if Input.is_action_pressed("Left"):
	position.x -= speed
	if is_on_floor():
		animation.play("Walk Left")
elif Input.is_action_pressed("Right"):
	position.x += speed
	if is_on_floor():
		animation.play("Walk Right")
else:
	if is_on_floor():
		animation.play("Stand")

Thanks to you saviour

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.