Label flipping. How to stop text from mirroring


For my NPC i flip the scale to change directions.
Any idea to avoid flipping the label?

my current code in the area2d Node look like this

func label_flip()
	if get_parent().scale.x > 0:
		scale.x = scale.x * -1
	elif get_parent().scale.x < 0:
		scale.x = scale.x * 1

My Code in the NPC Node

func flip():
	facing_right = !facing_right
	scale.x = abs(scale.x) * -1
	#Change the speed direction
	if facing_right:
		speed = abs(speed)
		speed = abs(speed) * -1

Screenshot 2024-06-29 232530
Screenshot 2024-06-29 232836

dont make the label as a child of animatedsprite2d/sprite2d
make a Node2D as a parent then have animatedsprite2d/sprite2d and Label inside it as siblings
so you only need to flip the animatedsprite2d/sprite2d not the Label

1 Like