I use this function to move the player, but the flip doesn't work. when I try scale.x = -10 it seems to multiply by -1, thus constantly flipping in the opposite direction than a moment ago.
func _move() -> void:
var horizontal := Input.get_action_strength("move_right") - Input.get_action_strength("move_left")
var vertical := Input.get_action_strength("move_down") - Input.get_action_strength("move_up")
var vector := Vector2(horizontal, vertical)
if vector == Vector2.ZERO:
if current_state == 'run':
_set_animation('idle')
else:
if current_state == 'idle':
if horizontal == 1:
scale.x = 10
elif horizontal == -1:
scale.x = -10
_set_animation('run')
move_and_slide(vector.normalized() * move_speed)