Sprite flipping constantly on left side

Godot Version

4.4

if global_position.x < mouse_position.x:
		scale.x = 1
	elif global_position.x > mouse_position.x :
		scale.x = -1
	

Question

anyone know how to fix this? its only happening when the mouse is on the left side of the character. Ive tried adding to the mouse position but it only offsets it and still constantly flips

If that is a character body, then move and slide will reset the scale since you are not supposed to change the scale of physics bodies. Instead flip the sprite only.

2 Likes