Sprite distortion while moving diagonally

Godot Version

4.2

Question

Hi guys. I’m trying to do a horizontal movement, but the image always ends up suffering from severe distortion. Does anyone know what might be causing this?

func _ready():
	pos = position


func _process(delta):
	#position += Input.get_vector("left", "right", "up", "down") * delta * speed
	if Input.is_action_pressed("right"):
		pos.y += 1 * delta * speed
		pos.x += 2 * delta * speed
		
	elif Input.is_action_pressed("left"):
		pos.y -= 1 * delta * speed
		pos.x -= 2 * delta * speed
		
	elif Input.is_action_pressed("down"):
		pos.y += 1 * delta * speed
		pos.x -= 2 * delta * speed
		
	elif Input.is_action_pressed("up"):
		pos.y -= 1 * delta * speed
		pos.x += 2 * delta * speed
	
	position = pos

If you are trying to make a character, you should learn to use the CharacterBody2d System from godot. Here you can find the documentation about it.

2D movement overview