Button To Change Sprite (Help)

Godot Version

4.3

Question

I’m making a dress up part of a game, and I can’t seem to figure out how to use buttons to change which part of a spritesheet is being looked at.

So it’s similar to a character creation where i want the button to change which (for example) Hair it’s looking at. I have it in a spritesheet instead of every piece of hair in their own picture, so I don’t know how to make the button press change which sprite is being shown.

Like instead of 6 different eye pictures, I have this.

I can make it change with different pictures but that’s not only tedious but I’d have to dismantle a lot of my code to make it one by one.

1 Like

Assuming you are using Sprite2D:
In inspector menu of a sprite select “Animation”, there gonna be “Hframes” and “Vframes” properties. Set them both, for this case, to 3. After that you can just change frame to switch between sprites.