Stop animation when on floor

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Raptorkillz12

I am Having trouble with animations when I press up key it won’t play jump instead it plays
Run.

`extends CharacterBody2D

@onready var _animated_sprite = $AnimatedSprite2D

func _physics_process(delta):
# Add the gravity.
if not is_on_floor():
velocity.y += gravity * delta
_animated_sprite.play(“default”)
# Handle Jump.
if Input.is_action_just_pressed(“Jump”) and is_on_floor():
_animated_sprite.play("Jumping ")

	velocity.y = JUMP_VELOCITY

# Get the input direction and handle the movement/deceleration.
# As good practice, you should replace UI actions with custom gameplay actions.
var direction = Input.get_axis("Left", "Right")
_animated_sprite.play("running ")

	

`