walk animation not working

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

so im making this mario bros thing and the walk animation is not working

extends KinematicBody2D


func _ready():
pass

var motion = Vector2()
var SPEED = 600
var JUMP_HEIGHT = -1000
var GRAVITY = 10
const FLOOR =Vector2(0, -1)

func _physics_process(delta):




motion.y += GRAVITY
if is_on_floor():
	if Input.is_action_just_pressed("jump"):
		motion.y = JUMP_HEIGHT
	
motion.y += GRAVITY

if Input.is_action_just_released("jump") && motion.y < 0:
	motion.y = 0
if Input.is_action_pressed("left"):
	motion.x = -SPEED
	$Sprite.flip_h = true
elif Input.is_action_pressed("right"):
	motion.x = SPEED
	$Sprite.flip_h = false
else:
	motion.x = 0
	
if is_on_floor():
	if 0 == 0:
		$AnimationPlayer.play("idle")
	else:
		$AnimationPlayer.play("walk")
else:
	$AnimationPlayer.play("jumpin")


motion = move_and_slide(motion, FLOOR)

pass
if is_on_floor():
    if 0 == 0:  # ???? Problem is here
    # if motion.x == 0:

ramazan | 2022-09-18 17:48

:bust_in_silhouette: Reply From: harden32x
if is_on_floor():
    if 0 == 0:  # Change the first zero by "motion.x"