Godot 4.4: How can I "Flip H" for just one animation in AnimatedSprite2D?

In the Inspector panel for an AnimatedSprite2D, there’s a “Flip H” checkbox:

…but it horizontally flips all of my sprite’s animations. How can I “Flip H” just one animation?

In the Godot beginner lessons, there were already pre-existing flipped animations in the spritesheet. I’m trying to work out what to do if I have a spritesheet where the character is only facing right.

image

Thanks for your time.

Hi there,

Can you let me know what course this is for? That why I can tag it appropriately

Actually I found the answer in one of beginner lessons (“Martian Mike”). You flip the sprite programmatically as it’s moving.

		direction = Input.get_axis("move_left", "move_right")

		if direction != 0:
			animated_sprite.flip_h = (direction == -1)
1 Like

Yup, that’s the correct answer. Pretty much everything you see in the Inspector (of any node) can be controlled in a script - it’s just a matter of figuring out what it’s called in-code, and what exactly it’s a member of (because Resources and inheritance can complicate that). It takes some getting used to, looking up Docs pages and navigating the inheritance chains at the top, but it’s not bad at all once you’ve done it a few times =)

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.