Broken Character controller

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

So I was working on redoing my sprite from an AnimatedSprite2D to a Sprite2D that uses a AnimationPlayer for greater control for allowing multiple weapon pickups and such; however, after I made the update, the controller broke.
I copy pasted the code into a different CharacterBody2D and replicated what I had before I updated to the AnimationPlayer and the code seemed to work fine there.
The issue is the code no longer works for my updated character which is strange.

here is the main code:
func _physics_process(_delta):

var directionLR = Input.get_axis(“walk_left”, “walk_right”)
if directionLR:
velocity.x = directionLR * SPEED
velocity.x = 0
var directionUD = Input.get_axis(“walk_up”, “walk_down”)
if directionUD:
velocity.y = directionUD * SPEED
velocity.y = 0

if Input.is_action_just_pressed(“attack”) and Input.get_axis(“walk_left”, “walk_right”) or Input.is_action_just_pressed(“attack”) and Input.get_axis(“walk_up”, “walk_down”):
#Attack Animation
if Input.is_action_just_pressed(“attack”):
if Input.get_axis(“walk_left”, “walk_right”) or Input.get_axis(“walk_left”, “walk_right”) and Input.is_action_just_released(“attack”) or Input.get_axis(“walk_up”, “walk_down”) or Input.get_axis(“walk_up”, “walk_down”) and Input.is_action_just_released(“attack”):
#Run animation
elif Input.is_action_just_released(“attack”) or Input.is_action_just_released(“walk_left”) or Input.is_action_just_released(“walk_right”) or Input.is_action_just_released(“walk_up”) or Input.is_action_just_released(“walk_down”):
#Idle Animation

:bust_in_silhouette: Reply From: Moreus

Make Debug Logs with print

You can check all variables and loops