Godot Version
4.3
Question
How do I test the movement before move_and_slide and only execute it if there is no collision with that specific direction? I tried using test_move() but it seems kind of confusing to me.
##This function handles the player's movement. It checks if there's any input,
##applies friction if not, or moves the player and updates the blend position if
##there is input.
func _move(_delta:float, vector_direction:Vector2):
if not movable: return
#Not Moving ================================================================
if vector_direction == Vector2.ZERO:
_state = IDLE
_apply_friction(FRICTION * _delta)
#Moving ================================================================
else:
_state = WALK
_apply_movement((vector_direction * ACCELERATION * _delta)*MIN_SPEED)
_blend_position = vector_direction
move_and_slide()