No execute player movement if colision will me made

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()

No collision or no input? If just collision:

if get_slide_collision_count() > 0:
    return

Trying to understand what you mean “only execute move_and_slide() if there is no collision with that specific direction” since if there’s ever a collision with your CharacterBody and CollisionShape/RigidBody/etc. it will calculate the safe_margin and then handle that collision as a part of move_and_slide() on your behalf anyways.

I mean, if the player is standing next to a wall to his left, he will not try to perform movement or animation if the input is to the left.