You're probably right. How would I implement that into my code? I've looked through the qa's on here and I don't see how I would fit them into my implementation. Here's my code for my walking state:
func walk_state(delta):
var input_vector = Vector2.ZERO
input_vector.x = Input.get_action_strength("ui_right") - Input.get_action_strength("ui_left")
input_vector.y = Input.get_action_strength("ui_down") - Input.get_action_strength("ui_up")
input_vector = input_vector.normalized()
var motion = velocity * delta
if input_vector != Vector2.ZERO:
animationTree.set("parameters/Idle/blend_position", input_vector)
animationTree.set("parameters/Walk/blend_position", input_vector)
animationTree.set("parameters/Defend/blend_position", input_vector)
animationState.travel("Walk")
velocity = input_vector * MAX_SPEED
else:
idle_state(delta)
if Input.is_action_just_pressed("defend"):
state = DEFEND
move_and_collide(velocity * delta)
move_and_collide(motion)